This cleans up a bunch of things in the code without adding or removing any features. See the commit-log for changes.