Second pass at supporting namespaces, SVG

Update the fragment code to keep track of the last namespace, and
generate output based on those namespaces.

dom_helpers -> dom-helpers