Revamped grammar matching to be line based.

We now match a line at a time, and keep track of the matcher state at the end
of each line (ala first-mate). When the buffer is edited, we just completely
rematch the affected lines, starting from the first edited line and work our
way down.

During normal editing, this means we rematch the same line over and over again
as characters are typed. Matching is pretty efficient, so this is good enough
for now and probably forever.

I'm seeing some weirdness with the Java grammar, but that may be regexp
related, or something else, so I'll pinch this off here and investigate that
next.
Revamped to use -1 to indicate no match.

Some matches do not advance the match position, they just push new matchers
onto the stack, so we have to allow for a match where end == start (which we
previously took to indicate no match).

This means that it is now possible to infinite loop if a non-stack-pushing
matcher matches and advances zero, but we catch that at the source and ignore
such degenerate matches.
Only update lastPos when it advances.

It's possible for a scope to be popped with a pos earlier than lastPos and we
don't want that to move pos back and start adding new spans from there, we just
want it to pop the scope from the stack.
Made Selector.Processor use Selector.Fn.

(Selector, (Buffer,Loc,Loc) => Unit) was getting too hairy, and I wanted the
ability for said Fns to generate civilized toString output for debugging.

It's perhaps a bit cheeky to overload Fn, which we use elsewhere, but my cheeks
are large.