Migrated to mongodb 2.6.x and pymongo 2.7