Support for using a custom http.Agent

This adds the support for the option 'agent' to specify an httpAgent to use for the REST calls to ES.

Possible values:

- undefined (default)
- false (no http polling)
- a custom instance of http.Agent

For example one could use this parameter with the
agentkeepalive (https://github.com/TBEDP/agentkeepalive)
to attempt to keep the http connection opened.