Implement #77 and rework some of the document structures to reflect previous changes