added Document typeclass with document methods
initial tests for Document, api.md updated