Reverted HEAD~17..HEAD (all changes made from upstream).

My goal had been to switch from a manual install to using the native
packages APT repo. Unfortunately, the APT repo for sonar is unsigned,
which makes that approach a poor one.

I may come back through and cherry-pick some of the other commits that
made other changes.

(Seem to have got it right this time.)