Allow override of http client and improve tests/coverage