add switch for using cname to find environment to update
rename optional environment property
waitforcommand uses curEnv for getting environmentRef