Checking of phases working
Before Cleanup
Added the ability to check phases and lay on phases. There are a few TODOs in the code of places that I know we are going to need to do some more work on. Many files changes in these lasy few commits.
Addition of a PhaseStateTest Class for Testing

Class for testing phase state.