Simple state machine based controller framework.