Make a state machine out of Sparky.