Initial attempt at global context menu
Move toggleChildren code to separate function