Encapsulate d3 listeners in a listeners function

The function is called after the menu has been created.