there is a bug here, probably an existing bug. If I have two keys: `foo` and `foobar`, and you try to replace `:foo` first, then it will invalidate `:foobar` as well. The solution is to sort the lookup array so you try to replace the longest keys first.