element removal

added safe element removal, which makes sure to remove all outstanding event listeners that this element registered.