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
Fixed to compare the return value against the hash that the stub_request returned.