Added a StateInfo class and some unit tests for it.