Added JSON support for documents.