finished refactor of HTTP client... still needs proper cookie handling,
but good enough for now.

separated test code and removed "success path" console.logs