Download manager refactoring for stability and maintainability & better tests of the Update system.