Lazy compile nested submenus

Very important commit - it's a tremendous performance boost for nested
menus. Deep menus with lots of submenus were able to bring the
application almost down - it's just not acceptable when a user hovers a
token and has to wait 1-2 seconds. Can't really say what the Big O of
this was, but it was definetely bad.

We only insert submenus when they are really needed now, which means
that there is never more than one menu layer that needs to be inserted
in the DOM. Very snappy.