Cleanups and other small fixes around package management

@keertip 

The only real change here (the one that has prompted the whole thing) is the adjustment in the signatures of the abstract `PackageManager.installPackages` and `PackageManager.upgradePackages` (the signatures of the overriding concrete methods in subclasses have now changed).