Reorganize the tests.
Fixed cursor's StateKey to return the same value until the state is mutated. Fixes #35.