Better http client constructor.

This is based on #51