For the moment, copy ha_tools.py from PyMongo to Motor for replica-set testing