Refactored for testing

- Extracted plugin logic to command class
- Add test for ViewFormatter
Caret position is now preserved after format

- Fixes #7