Make all environments available from modules.

This is another step towards #1750.  Also, will be helpful for fixing #1793 (more to come on that front in a future PR).