Optimization for first-line matching. Fixes #219.

Instead of reading the whole first line (which might be really long),
now we just read the first 250 characters, lop off everything after
the first newline, and check the regex against that instead.