removed unneeded guard in stateComparer
Major refactoring in $state goto.