WIP
WIP: Cleanup jshint issues; rename state transitions; functional tests broken