Move headers out of API directory 'cos they aren't APIs.
First version of state machine code, largely empty of event handling at the moment.