(PUP-3355) Remove PSON document_type

This commit removes the encapsulation in the PSON serialization format.
Puppet only did this when using PSON on certain endpoints, other formats
like YAML or MsgPack never did this.

This is backwards compatible with older Puppet versions as they throw
away the info if it is there. But it is backwards incompatible for other
consumers of the PSON APIs.
(PUP-3355) Remove Puppet::Util::Pson

Remove the now unused Puppet::Util::Pson class.
(PUP-3244) ENC ignores missing directory environments

When using an ENC, if an environment that didn't exist was defined for a
node puppet would place the node into the production environment instead
of raising an error to alert the user that the environment that had been
requested did not exist.

This commit changes the behaviour when an environment is defined in an
ENC but does not actually exist. Instead of placing the node into the
production environment a Puppet::Environments::EnvironmentNotFound error
is raised.
(PUP-3244) Acceptance Tests for Nonexistent Environments

Added acceptance tests to test if an error is raised if an ENC specifies
a nonexistent environment for a node.
(PUP-3244) Validate Environment Before Setting

Before this commit the environment validation was happening for the Exec
terminus instead of on the node object itself. This fix should help all
node objects from having invalid environments when its environment is
set using `Puppet::Node#environment=`.
(PUP-3393) Minor typo fix in relationship_spec.rb

There were a couple of typos relating to ALL_EVENTS in
relationship_spec.rb.
(PUP-2995) Move custom oid mapping file management to application/master.rb

* As suggested by @adrienthebo, custom oid management was moved to application/*.
* Custom oid management is only involved if `trusted_node_data` is activated.
(PUP-3244) Add Puppet::Environment::Directories#get! method

This new function will return the directory environment or raise an
error if a directory environment does not exist. This gets rid of the
need to check if environments exist across the codebase before
continuing for the areas where we need.
(PUP-2995) Change custom OID format and apply code advices.

* As suggested by @ffrank, custom OID file format was changed to use Hash structure.
* Apply code modifications suggested by @ferventcoder.
(maint) Modify other uses of get() to get!()

There were several uses of get() that either immediately checked for nil
and raised the UnknownEnvironmentError or assumed non-nil and continued.
This changes all of those cases to use the new get!() method and so be
explicit that they require an environment. There are a couple uses that
still don't require the environment to exist.
Merge branch 'pr/3146' into stable

* pr/3146:
  (maint) Modify other uses of get() to get!()
  (PUP-3244) Add Puppet::Environment::Directories#get! method
  (PUP-3244) Validate Environment Before Setting
  (PUP-3244) Acceptance Tests for Nonexistent Environments
  (PUP-3244) ENC ignores missing directory environments

Closes GH-3146
(PUP-3244) Remove unnecessary Cached.get!

This removes a function that was provided by the super class.
(PUP-3244) Remove redundant methods and refactor.

Before this commit the Puppet::Environments::Cached#get! was not needed
as it was defined in a parent class. Puppet::Environments::Combined#get!
now calls get! in environment objects instead of assuming how get!
should work.

This commit also refactors areas in the code where
Puppet::Environments::EnvironmentNotFound was raised after calling get
in favor of the new get! method.
(PUP-3244) Remove unnecessary Cached.get!

This removes a function that was provided by the super class.
Merge pull request #3179 from ferventcoder/ticket/stable/PUP-3244-enc-cached-get

(PUP-3244) ENC directory environments - Remove unnecessary Cached.get!
Merge pull request #3182 from demophoon/fix/stable/pup-3244

(PUP-3244) ENC ignores missing directory environments
(DOC) Clarify resource_type api GET may be for a class, type or nodename

A GET resource_type may request a class, defined type or node by name.
The doc example was just :nodename, which led me briefly astray when I
was querying this endpoint; so I changed it to read
:class_type_or_node_name to make it a little clearer.
(PUP-3244) Allow autoload to handle missing environment

When a previous commit changed from get() to get!() the agent stopped
being able to use an environment that is available on the master, but
not available locally. I had misread the code and missed a trailing
`&&`. This caused me to think that the environment lookup in this case
was required, where in fact it is still optional.

This changes the structure of the code to make it much clearer that the
environment is optional, changes from get!() to get(), and adds some
tests around these code paths.
Merge pull request #3185 from jpartlow/maint/master/clarify-resource-type-api

(DOC) Clarify resource_type api GET may be for a class, type or nodename
(maint) Add "catalog_memory" benchmark to output heap and show mem info

This adds a benchmark "catalog_memory" that is running an empty catalog
(one call to log). A baseline sample of memory is taken at first run,
and at last. A diff of bound objects is produced. Two heap dumps in json
formats "diff.json", and "heap.json" are produced. The diff contains the
dump of each bound object, and the heap a dump of all objects.

The benchmark also prints basic information about memory.