Add d3 exit handlers.