Split search string into chunks

A function that splits a search string into chunks of matches and
non-matches based on search results in this string.
Rewrite the naive html replacer code

Instead of naively replacing all matches in the HTML code, which has a
nasty side effect of breaking URLs and such, extract only the text nodes
from the document and perform search and replace on them.

There's a known class of cases that this can't handle yet: a document
like <p>a 100 <strong>miles</strong>!</p> will be split into three text
nodes, ["a 100 ", "miles", "!"], and a search across none of them will
find a match. But the old code couldn't do that either, so it's OK.
Bump version