Modified pymongo/connection to allow mocking the connection with MongoMock and similar libraries