simple state machine framework used by other projects.