Add event handler tracking to an object