FoundationDB/sql-layer — pull request #1222 by nathanlws (2014-03-10 15:09:26+00:00)
Title: LIKE fixes and cleanup

Original motivation was bug noticed by the first commit and an isolated fix in the second. However, the line being changed was quite dense and the change made it even worse.

While reviewing the Matchers implementation a number of issues stood out:
- Very dense lines (e.g. compound assignment in whiles)
- Large chunks repeated, some slightly different
- Unclear interactions between base, derived and helpers
- Misleading comments
- Additional bugs (e.g. beginning of line escapes, conflation of _ and \u0000)

Fix all of that now instead of waiting for issues to crop up one at a time. The guts of the matching processing is essentially the same (split around %, non-greedy search and right-most instance jumping on mismatch) but everything leading up to it had a big broom passed through.