Reduce number of intersection checks when undoing highlighting

Intersection checks become very expensive when updating the highlight
on a large document. Intersections can only occur at the start and end of
a range, allowing only two of these to be necessary.

Note, the range end doesn't need to be reset, as it is immediately updated
in the following lines.
Only update range once after removing highlight on all text nodes