Add state tests to match-state
Add state tests to match-state

Fix a bug it found:
Patterns need to commit matches before continuing so that subsequent
resolve-patterns can see the matches. However, this doesn't work for
star-patterns because they need to test at each step whether the rest of
the pattern matches. I could have them temporarily commit a match and then
roll it back if it fails, but I hope that I just don't need state for
star-patterns.

sandersn/elements-of-ai,sandersn/elements-of-ai