Refactor some wiring gunk into ManualDocumentBuilder

+@themitchell