Lots of small (mostly stylistic) code changes.
Merge branch 'master' into editor