Move away from gevent.core.timer (ie, use greenlets)

The original version of this was written in Perl, and co-routine-based
systems like greenlets are not possible there.  Having an active gevent
timer is not sufficient to stop the program from exiting: it needs actual
greenlets.  So switch to gevent.sleep() and imperative loops, and watch it
all get much tidier.