Migrate from MongoDB to Postgresql

**WORK IN PROGRESS, DO NOT MERGE**

see documentation commit for details