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.
Also, removing it here means there's a linting failure because `degree` is defined but not used.