Jump to (rather than search for) declarations if possible

Rather than just blindly adding 'search for declarations' to the menus for types, functions, and variables, we now check how many decls there actually are. If there are none, we do nothing, if there is one then we add a jump entry so we go directly to the decl, otherwise we add a search entry like we did before (plus add the number of decls which will be found there).

The second patch improves behaviour if the menu if for a decl. Now we never add a jump entry and only add a search entry if there are other decls.