Bug fixes and behavior improvements

- Fix smart mode cursor shifting behavior when typing open paren before
  paren trail
- Improve cursor shifting behavior when over typing over existing close
  parens in a paren trail
- Fix 'precarious paren expression' handling
- Fix incorrect paren trail information being returned from paren mode
- Fix incorrect behavior when moving the cursor through a paren trail,
  resulting in unwanted movement or dropping of close parens
- Fix possible invalid end iterator dereference in indent mode