Started work on a state machine framework