refactored the dependancy code so that the state determination is done in the objects concerned. This removes a heap of 'instanceof' and if statements.
further refactoring, now there is no instanceof at all, and the state determination is done completely by the children.
Still some work to do to add things like extra tests, and sub states (eg: development in progress)