Renames and cleanup.

* Use @override_settings for test_lack_of_www_authentication
  in test_middleware.py because it's much cleaner.
* Rename the base64 encode/decode methods for extra clarity.
* Other small style tweaks.