Tidy up reader/writer/state
Added vending state machine demo