Fix attachments missing from DocumentRevision

Retrieving a document via getAllDocuments returns document with their
attachments missing.
Fix document retrieval for getAllDocuments and getAllDocumentsWithIds
Add tests for attachments on objects retrieved from getAllDocuments and
getAllDocumentsWithIds