Reworked environment variable system to be synchronous. Simplifies the code. All tests are passing.