Fix awkward context handling

Switching the match_* methods so they're always invoked on the Parser
object, where they belong (since they're invoked before any Parser
instance exists). This has nothing to do with how their inner closures
get invoked -- those still run on a parser instance, so they still
have access to vcache, etc.
refactor match_range
simplify match_range logic further