(maint) Log invalid modules

Give notice when a module on the modulepath is invalid, explaining why.
To do this cleanly, we stop trying to add "." and ".." as modules since
these are always invalid.
(maint) Avoid checking for strings in module_references

module_references contains Hashes so there is no need to look for
strings within it, especially when the next line does what this one was
supposed to do.
(maint) Verify module exception is logged

Verifies that if puppet fails to load a module, e.g. missing metadata,
that we log the exception:

     $ bundle exec puppet apply -e "include mymodule"
     Error: No dependencies module metadata provided for mymodule
     Error: Could not find class mymodule for ...
(maint) Refactor tests to use helper to create module directory

Refactor tests to use PuppetSpec::Modules.generate_files to create
the module directory. Note the order of arguments is reversed.
(PUP-3665) Fix resource overrides for 4x collector

Prior to this commit, the new implementation of collections caused
overrides to fail if the given attribute was a Resource. This was
because 3x required an instance of Resource rather than PResource
Type. In order to fix this issue, transform the override attribute
into the appropriate format for the 3x compiler.
(PUP-3512) Remove the old Profiler profile API

Remove the old Profiler profile API, which supported calls to
profile without a metric ID. Remove tests that ensured the
old API worked.
(PUP-3511) refactor Application.run for reuse

Extract a small chunk of code from Puppet::Application.run into its own
method so that it can be reused.  This code is currently duplicated in
Puppet Server; the introduction of this new `reset_environment_context`
method enables the replacement of the duplicated code in Puppet Server
with a call to this method.
(PUP-3511) refactor 'configure_indirector_routes'

Add a `self` version of `configure_indirector_routes` which takes the
application name as a parameter.  This method is currently copied into
Puppet Server, and the new version of it will allow for the duplicated
version in Puppet Server to be deleted.
(PUP-3511) introduce 'ApplicationSupport' module

Introduce a new module named 'ApplicationSupport'.  Move
'configure_indirector_routes' into this module.  Move
'reset_environment_context' into this module, and rename it to
'push_application_context'.
(PUP-3511) yardoc for 'push_application_context'
(PUP-3511) update docs in 'ApplicationSupport'
(PUP-3096) Remove deprecated trusted_node_data and immutable_node_data options

This commit removes the deprecated trusted_node_data and
immutable_node_data options from puppet/defaults. This ensures
that $facts and $trusted are always available so that we can
start phasing out facts as top-scope variables.

This commit is part of the Puppet 4 code removal effort.
(PUP-1035) Remove server component from pluginsource and pluginfactsource

Previously, the pluginsource and pluginfactsource settings would always
use the $server as the host component for their respective URLs. This is
fine for non-SRV environments, but is not compatible in SRV
environments.

This change will allow pluginsync and pluginfactsync to use SRV records
to determine which host to connect to. This change should not affect
environments where SRV records are not being used.
(PUP-3560) ASN.1 encoding/decoding handled properly

Because Ruby's OpenSSL lib munges unknown extension values so bad
(it turns non-printable chars into '.' characters) there's no way to DER
decode them. I ended up having to DER decode the entire certificate and
decode the extensions manually.

Regarding test changes, due to a bug in OpenSSL::X509::Extension the netscape comment is not
parsed correctly now that it is being properly DER encoded. I ammended
the test to compare the comment string with the buggy characters in it.