• ElementSet is now ElementMap again because it's now internally a map
of a Document and an array of Elements, but it's public API is still
that of a set.
• Template elements are now only added as a reference in ElementMap when
they're appended to a document. If they're removed, they're removed from
ElementMap. If a template element's owner document is destructed then it
and all of the other template elements in the document are removed from
ElementMap.