Replace lexer with a hand-written one.

Based on Go's bufio.Scanner using a custom Split function and a hack
to pass around token type along with its value.

Three first bytes returned by the scanner are the type, remaining the
value.