Switch to fsm schema

The diagram is one thing, but running the FSM should be DRY across different programming languages.