Use ranges when applying a style to better handle DOM changes

When first created, the text style applicator used to move nodes around
within the first while loop, often modifying the limiting range in ways
that were not expected.

In 5a86bdd, this behaviour was re-written to gather all the relevant
nodes and migrate them once all siblings in the container were checked.
With this change, it is now best to use the range once again, as this
avoids additional problems (see the modified test) with new children
being added within the range if new styling containers are inserted.