Extract viewport management logic into standalone system

Simplifies the caret class, and allows more exotic view configurations
to be inserted without breaking core code.

As a bonus, the new Viewport class is able to scroll arbitrary
rectangles into view.
Scroll the annotation node into view after creation

Makes annotation insertion feel cleaner as the user can now see the
complete annotation on insertion.

Fixes #486