Add logging. Add argparse command line options. Improved handling of gevent.monkey.