State machine documentation

This branch contains the documentation files for the new state machine layout. Not ready for merging yet, but very active work in progress.