Refactor StateChanges into a tree of IStageChange providers - fixes 361

Fixes #361.