Corrections to no_proxy support and tests.

- Used unless instead if not
- Changed regular expression, so it filters a leading dot or star
- Make the match case-insensitive
- Created a functions cleanEnv, setupEnv, and restoreEnv,
  to setup an environment for the test.
- Cleaned environment of proxy/no_proxy variables in tests, which failed