Removed some logic from the page template.

Removed the logic for constructing the page title out of the template and
into the Document class as the logic was being duplicated in the template.