create a document class to handle traversal by formatters.

Right now this requires  splattered throughout the code to maintain passing tests but these will be replaced soon enough.