Added script to generate static hashtables for command states
Converted the controller's state machine to new design

This design gives each command one or more states exclusive to the state of whether
we're reading form the config file or the script pipe.  This way if a command needs
to perform multiple writes, they can be interrupted and let the command resume when
the output pipe becomes writeable again.

The script that generates the command hashtable is now also generating a function
to look up the name of a state, for debugging purposes.