Throw error if environment variable doesn't exist

Handling of environment variables was previously all over the place. This standardizes it:
* Puts string at top of file.
* Throws an error if environment variable doesn't exist
* Exception: Admin username/password throws a special exception and doesn't use the standard.