Bit of clean up around scroll pages
Bit of clean up for the unit tests
Fix caret position on line scrolling

When doing line scrolling (Ctrl-U, Ctrl-D) the caret will now maintain
the same relative offset from the top of the file that it had before the
scroll operation.

closes #858