Incredibly large refactor of the backend to enable direct manipulation of the mongodb dicts without intermediate python objects in the way.