Refactoring State Server.
The state server was beginning to become more complicated than I neccessary. It is now two distinct modules, one devoted to the APIs message handling, the other for maintaining state.