Various cleanup
(unfortunately, with a lot of gratuitous HTML changes)