speed up menus applet with large num of apps

This change to the menu applet greatly speeds its creation when there is a large number of apps, and may address the complaints about sluggish menus.  The previous algorithm for removing duplicates in menus was O(N**2), and this patch uses the has to make it O(N).