Add authentication support

Useful when ES is fronted by an authenticating proxy.

(Re: issue 109)