improved env merging, added spec tests for PuppetCommands