Fix trailing whitespace, typos, and header uniformity.
Eliminate all calls to terminate() when dealing with QThread.
Improve testability of installation code by refactoring it to completely separate the GUI and non-GUI code, and to provide more robust support for non-GUI access to some type of Addon Manager activity.