Check `node.parentNode` to see if the `child` exists in its list of children, if it does, remove it. Should be faster than  a deep enum check :/
Correctly handle which open tag is selected. Its the last matching tag in the array, not he first :/
Minor