Add mongo as relational
Rewrite nested_document_factory
Clean code for nested_document_factory