Implement gevent-style monkey-patching