Rebased on gEvent, and generally cleaned up.  Now for regular incremental commits.