Fix document display code

Fixes GH-1. Also a bit of refactor in the DocumentView class.
Merge pull request #2 from WChargin/document-fix

Fix document display code