Sketched out auth

This is a quick take on auth. But we'll need to reorganize a bit, not just for auth but for config in general, if we want to support multiple instances of the client at the same time, each talking to different servers. (Right now config is global, rather than per-client-instance.)

Currently integration test is failing in phantomjs with the following error when I try to use basic auth (though Bearer auth appears to work)

```
  SECURITY_ERR: DOM Exception 18: An attempt was made to break through the security policy of the user agent.
```