WIP: database creation improvements.
WIP: add time management ns.
WIP: move json ns from storage to core.
WIP: fix rev generation function to new document type.
WIP: big refactor to document and protocols.