Fixed logic issues in both specification and implementation of State.end_of_states algorithm. Current set of specifications are satisfied. Still  needs refactoring, but waiting to draw lines until multiprocessing is considered. Also still could use more detailed specification of the algorithm.