surface::appendContent and related functions: allow text nodes as boundary points; track top-level text nodes for removal