Cleaned up mongo stuff with new module structure.