Add parenv & to_env functions.
And be more consistent about how functions accept environments