`addBeforeID` (which could indeed be renamed `finalizeNewEdits()`, I'll do that) is called whenever an existing, unchanged element is found... because once that's found, we know the `beforeID` that is relevant to all of the edits that are currently in newEdits. Once we add that information, newEdits is cleared.

Imagine that we have (new element) (new element) (existing text) (existing element). Both of those new elements will be in the `newEdits` list and both need to be `beforeID: (existing element)` with `beforeText: true`. Something that did occur to me, though, is that we could have a situation like this:

(new element) (new text) (moved element) (new text) (new element) (existing text)

All of those edits that are adding something before (existing text) would need to be `lastChild: true` and `beforeText: true`. I should modify the test for that.

The part that adds `lastChild: true` should not touch `beforeText`, because if it's there it is actually still relevant (as in the example above with the (existing text) as the current last child).