Add stateFromJSON/stateToJSON hooks, fixes #6.
Update CHANGELOG
0.8.0