Refactor services as a state machine with state.js

[State.js](http://statejs.org) is one of the most powerful libraries I have used. My exposure to it has shaped how I view problems, because I've come to realize that life is just easier if you admit defeat and actually use one whenever it is appropriate.

The initial code I had written here was one of my attempts to avoid going full state machine, but then being caught up in the minutia of managing multiple levels of state in one object.

While I could just have written the patch and be done with it, I felt it was necessary to move slowly and document the changes in the commits, so that I could point other developers to this pull request to get acquainted with state.js.