Add tests for State

State provides a few crucial methods for the framework, which get
tested now.