Let's stick this new stuff into the existing ``environment`` module (since it has no external dependencies and could be useful in environment checks someday).