Reset cached document information when loading a new document.

When loading a new document, some information is cached like the height of the document. This wasn't correctly reset when a new document was loaded. Now, all cached calculations are reset and the scroll offset is reset.

Bug: #3