Method for adding DOM nodes. Always returns a valid node, defaulting to a documentFragment in event of error or null element type. add_nodes.baremetal.js is the stripped down version, removing many checks/sugaring. That code does not love you.