Simple C++11 FSM. No dependencies.