Switch to new environment.py library for config

I factored out a new library called environment.py to manage
configuration from environment variables. This commit replaces our
former usage of the envvar function with environment. The next step is
ot replace all of our direct os.environ access.
Merge pull request #2226 from gittip/environment.py

Switch to new environment.py library for config