Optionally accept a parameter with the preferred parent

This helps us to reconstruct a tree closer to what it was when we undo
from a delete, for example. This fixes some errors when we undo a delete
that happened at the boundary between a placeable (for example ph) and
the text next to it.