Make env vars first class citizen in CommandBuilder

Envvars are not passed to `CommandBuilder.popen`. They are neglected in a lot of other methods too.

Plus, `CommandBuilder.pwd` was not cloned.