include a class-level reference to the environment dictionary

Referring to the environment through the class allows easier subclassing and test mocking.