cleaned up naming of state machine stuff
more naming work.
fixed plain C demo