Fixed updating caret position

The caret is not updated when switching between files.

It turns out that load-caret-position was not being called and update-caret-position was being called before the app and file were refreshed.

This pull request should ensure that the caret position is being updated properly when switching between files.