Remove the optional argument to contruct_env. It simple if we always construct the env in the same place. Avoid using temp files, and avoid changing directory.