fixes #4699 - support Puppet environments API for directory envs

First use of Puppet's API...

* https://github.com/puppetlabs/puppet/blob/master/api/docs/http_api_index.md
* https://github.com/puppetlabs/puppet/blob/master/api/docs/http_environments.md
If I'm reading this correctly, I think you need to use mocks instead of stubs, as the former will raise errors if not called...