This is an attempt to address
- Tomas's point that _it should be possible to understand the state machine in a single place without having to navigate and piece together the behaviour.
- self-documenting states.
The solution is just to use a nested map. This is really simple and provides quite nice semantics. It is also very easy to iterate over the map and generate and dot representation, which graphviz will then render as png using
dot -Tpng states.gv -o states.png