First commit.  This is a basic non-threaded state machine approach.