Made the http client a parameter.
Test cleanup.