Rewrote the lexer.

I was really unhappy with my first attempt at the lexer. It was OK
except for its handling of arrays and comments, both of which completely
polluted the lexer and increased its complexity.

The key change was using a stack of state functions to maintain context.
This keeps sub state machines isolated and without knowledge of their
enclosing context, making every much easier to reason about.

The new lexer will also make new syntactic constructs, like tuples,
trivial to add.