added basic auth test, bit more MainHTTPClient refactor.

Changed SyncSchemeTest tests to use try/catch since now
client.getRequest() will throw an exeption on encoding errors.

Removed `addHeader` using `setHeader` and HashMap.