(PDB-454) Support for querying/returning environments for resources and facts

All v4 responses for resources and facts should now return environments. Also supported
is querying for environments using equals and regexes.

Needs https://github.com/puppetlabs/puppetdb/pull/908 to be merged first.