Refactor three phase into its own algorithm
Fix threephase to not build up infinite stacks
Update StateSteady to use three phase algorithm
Update test cases to actually test & pass
Merge pull request #39 from c00w/3phasesteady

Update StateSteady to Use the three phase algorithm
Merge remote-tracking branch 'upstream/master'