Fixes `string match`.  Hopefully flow is more clear.  Add new tests.