Add logging support and fix bug with multiple WWW-Authenticate headers

I ran into issues authenticating to servers that offer both Basic and Negotiate authentication methods.  This was due to the WWW-Authenticate header failing to parse in this case.  The pull request fixes that issue as well as the following extra changes:

- Added logging support via the built-in `logging` module
- Improved compliance with PEP8 formatting standards