Switch to auto-properties, lots of cosmetic changes

Applied a patch by GSerjo.
merge bug26509 into default