Speed improvements for tokenizer and parser

Also, benchmarks written with benchmark.js.