Breakup big remove method in tool_panel_manager.py to ease testing.
Separate out logic for dealing with toolbox from logic for dealing repository metadata in the database.
Unit test coverage for removing stuff from the toolbox.
Covers cases for tools inside and outside of sections and both deactivation versus uninstallation.
More toolpanelmanager unit testing.
Eliminate repeated nested object access in ToolPanelManager.remove_guids.
Reduce duplication/complexity in tool_panel_manager.py.

Big conditional in remove_guids switched on sectioned versus un-sectioned with very little difference in what was actually being done. This reduces the cyclomatic complexity of that method from 35 down to 26 (though it is still the most 'complex' method in that file by a wide margin).
Introduce new abstraction of tool lineages.

 - Don't force non-toolshed tools into the tool shed install database.
 - Abstract out dealing with the tool shed install database from toolbox, to potentially allow other tool lineages implementations.
Introduce ToolPanel abtraction.

There are some repeated operations on an odict in Toolbox that could be cleaned up (fewer lines of code, more readable) with new abstraction in place. Starting with __add_tool_to_tool_panel but will work its way to other methods in Toolbox eventually.

Abstraction reduces cyclomatic complexity of Toolbox.__add_tool_to_tool_panel from 23 down to 18.
Simplify toolbox.load_tool_tag_set method.

guid is taken as input but is always produced the same way from the same input, so just derive it inside the method instead.
Hide details of toolbox.tools_by_id from lib/tool_shed/util/tool_util.py.
Centralize abstraction for removing tools from toolbox.

Shield's toolbox.tools_by_id from lib/tool_shed/galaxy_install/tools/tool_panel_manager.py.
Abstractions for registering tools from outside toolbox.

Part of effort to further limit exposing tools_by_id directly outside Toolbox.
Introduce abstraction to prevent lib/galaxy/workflow/modules.py from needing tools_by_id.
Eliminate direct in/get checks against toolbox.tools_by_id - use get_tool or has_tool.
Eliminate walking over tools_by_id externally from toolbox.
Move more logic into ToolSectionElements, raising level abstraction in Toolbox.
Replace another repeated idiom in Toolbox with higher level method in toolbox.panel.