PEP8 and Python 3 fixes.

Most of the commits are about PEP8 fixes. Some include imports organizing as recommended in Two Scoops of Django.

The Python 3 fixes are mostly about classes inheriting from `object` explicitly, which isn't needed in Python 3.
Also replaced the % string format operator since it'll be deprecated as mentioned since Python 3.1.5. Mentioned in https://docs.python.org/3.1/whatsnew/3.0.html#pep-3101-a-new-approach-to-string-formatting




I quite like the new string formatting syntax, and if I was rewriting the book, I might use it everywhere.   But I don't think the old-style syntax is going anywhere anytime soon (I don't think it is officially deprecated in fact).