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.
Can be removed. I placed them there when I was testing the code. I forgot to remove that one.