Refactor out MongoDbContext.