Short-circuit corpus scan

Huge speed-ups by not scanning the entire html corpus when we only care about the beginning few characters.

Previously, the wikipedia benchmark was coming in around 7 seconds on my machine. With this change, it takes about 2 and a half seconds.