Add method to get a state out of the state hashtable.

This is required for unit testing.
Add unit test for changing a state.
Rename setter table to state table.

State table is much more appropriate and clear for the data structure.