A simple finite state machine. No deps.