A simple state machine written in C++11.