Code modernization

Replaced all instances of % formatting with str.format. Also ran resulting code through a barrage of pep8 compliance fixes. Mostly code aesthetic changes.
I'm not sure why those changed exactly. I only did one update in that area and it was to fix a merge problem I had with your last commit.