Extracted some Hypostasis::Document functionality into isolated support files to clean up the main module file.