Allow substitution on arbitrarily long lines.

This does not include the breakline feature, which is still limited to lines of length 50000.
Guess I'll tackle that one later.