Replicate pull request. Extra customization of pymongo.Connection