Refactoring _get_environment.

- Removes use of "global" by putting the env name in another
  namespace.
- Splits logic into digestible pieces.
- Also makes slight change to GoogleCredentials docstring.

This is the first chunk of #80. I'm happy to wait until #82 is in and rebase.
can you try a quick `make docs` and see how they look?