Added timer setup code for state machine scheduling
Added state machine framework