add tests for state.py
improve .reset() code; add tests
add tests; minimal code change
Added tag 0.8.5 for changeset bfd609a2a347