Implement lexer/rewrite parser.

Parsing directly to the AST requires redundancy like calling skipwhite()
before every function, or parsing an expression, then checking it it's
an identifier. Also makes adding comment-checking very difficult.