Propagate env vars and working dir to all cloned commands

Closes #1108.