Fix for #5006: inserting elements after a deletion

Copied from the commit:

Previously, `beforeText` was used in edits as a way to specify that
an element needed to be inserted before a text node and not immediately
before the node given. It turned out that keeping these text nodes
around complicated the logic and broke cases like #5006.

The real change here is that elementDelete events are added
and then the next pair is compared, which can result in more
text delete/insert events than was previously the case... but
it also results in correct behavior without the `beforeText`
change. Additionally, the behavior is now consistent for
element deletion whether it's being compared with text or another
element.


This also fixes up a couple of issues with the tests (the diagnostic stuff that prints when a test fails was broken since the big refactoring).

to @njx