Implement configurable factory for creating MongoClient.

This allows for customization of the MongoClient creation.