fix(Http): don't setRequestHeaders before opening connection

Also included is a refactoring to prevent recreating new functions, at the
expense of creating a small amount of garbage once per request, this should be
a tiny bit less wasteful.

Closes #41
I'm open to reverting the refactoring and just fixing the bug, this could wait for a different CL