[LiveHTML] Allow edits *before* a deleted item to be relative to it

For #5154. @dangoor 

This fixes #5154 (and miraculously doesn't break any other tests) by making it so that edits that occur before the deletion of an element can use it as their `beforeID`. This makes it so we can avoid cases where text nodes around deleted elements can end up not being handled properly.

(I'm not sure why it doesn't affect any other tests, but it's probably because we don't generally test edits that involve the deletion of multiple nodes while others are being inserted. We might want to add more of those.)

I was originally worried that this would be problematic for moves, but my read of the code is that moves are really just like insertions in terms of the order they're processed in, so they should work the same way.