Check for HTTP versus HTTPS and uppercase vs lowercase proxy env variable

This is basically what npm does.

No tests yet - not quite sure how to go about it. Going to dig into npm's tests and see what they do.