Refactoring to get rid of some confusing old names.
More confusing code refactored.
Refactoring of tool.index because it was too hard to understand and it's probably the entry point for people hacking on the code.