Improved the Document object and added a Database