More refactorings. Clarified document vs. section concepts.