Make self.document always the root document
Add documentation for self.document
Add test for self.document is root
Improve self.document

Add 'versionadded' tag and move _new-types back to proper place.
Make self.document always the root document.