states can now be read and written

* Closes #9 - there is however more work to be done relating to bubbles
  not being serialized into the states.