Experimental code for adding callbacks to handle when elements and attributes are removed