Httpclient 4.3

Refactoring and streamlining of the auth code; upgrade to HttpClient 4.3.1