Adding mongo integration, and general cleanup