Refactor StateChanges into a tree of IStageChange providers - fixes 361

Fixes #361.
Ah, no. It would demonstrate it if the first Deferred was not fired immediately. I'll fix that.