Update to 3.3

Update to newest diamond.

Lots of code cleanup, especially as regards installation and upgrades.