Fix the parser to not search until the end of the string all the time.

For very long strings, searching until the end of the string every time we
find a < is very expensive. In newer versions of JavaScript (ECMAScript 6) we
could use beginsWith, but that's not supported everywhere. This patch creates
one extra string per token, but significantly speeds up parsing very long
strings (~1mb).