Revise the way that auth is handled

* backwards support for standard text/html requests
* error handling for auth failure is more specific
Merge pull request #2 from jedschneider/master

Revise the way that auth is handled