Extract Document from DocumentManager

This is a fully compatible refactoring that extracts the Document "class" from within the DocumentManager to improve readability and clarify the distinction between the two concepts. To accomplish this, a few instances of Document methods directly accessing DocumentManager properties and methods were removed. To preserve compatibility, events that that are now triggered from within Document are proxied by the DocumentManager.

cc @gruehle