Tiny state machine implementation with clean separation between transitions, transition logic & state management.