Add support for no_proxy environment variable.

This is a squashed commit from @pixelblend effort.
Fix a few issues brought up during review of #247.

Reversing the precedence of environment variables. Getting tests to
pass. The normal jazz.