[Finishes #60048888] add code to remove unused menus, links and items.