(PUP-2519) Create the default directory environment

Directory environments are not guaranteed to exist; Puppet provides a
fallback staticly loaded environment for the default production
environment if it does not exist, but we would prefer to set up a real
directory environment if possible to provide a better experience for new
installations.

This commit adjusts the Puppet::Settings catalog to create the default directory
environment in the first `environmentpath` directory if that directory
exists.

Now that the production directory environment is created implicitly by
the Puppet settings catalog when we have an environmentpath, the
can_enumerate_environments test needs to expect that the production
environment will be there along with the two we have explicitly created.
(PUP-2519) Ignore module directories if env does not exist

Puppet::Util::Autoload will attempt to look up module directories in the
given or configured environment, but there is no guarantee that the
environment exists when using directory environments, and Autoload's
module_directories method fails if a nil environment is being handled.

Given that puppet applications now directly set the current environment
during their initialization and we have adjusted other points in puppet
that used to lookup the configured environment to instead use the
current environment, module_directories now skips and returns an empty
array if no environment is found during bootstrapping.
(PUP-2519) Create fallback environment only for default production

The goal here was to only produce a fallback environment for the default
'production' environment which would only be found if the production
directory environment did not exist.  All other cases would raise an
error during application start up if the environment did not exist.
Except for applications in agent mode which currently need the concept of
the environment they will be requesting, but should not have to create
or verify the existence of a locally matching environment in their
environmentpath.

A few other changes are made to further narrow the scope of code making
open requests for the configured environment:

* indirection request - looks up current environment now, relying on
  this having been set by whatever application is making the request.
* puppet apply - instead of creating a new loader with a single static
  environment, it overrides current_environment instead.
* puppet util commandline - does not attempt to look for additional
  plugins if there is no environment to search in.  It relies on
  application to raise an error instead, if necessary.
(PUP-2159) Serialize node.environment as environment_name

Puppet::Node used to implicitly lookup and set an environment instance
when deserializing it's environment attribute String.  On an agent run,
with directory environments set, this was likely to produce a node with
a nil environment.

Henrik Lindberg and I changed node to deserialize the environment to an
environment_name attribute, separating the process of deserialization
from lookup and assignment of an actual environment.  The configurer can
then check to see whether the node already has an environment, and if
not, if it has an environment_name, it can create a remote environment
instance for the node so the agent can proceed without needing a
directory environment to exist.
(PUP-2519) Set environment for request or fail explicitly

The Indirector::Request#environment= setter would fall back to looking
up an environment from the environment loaders if given something that
was not an actual environment instance. If directory environments have
been set, this can return nil, and while a Request#environment will fall
back to the current_environment, there was no warning that you have
attempted to set an environment and been ignored.

To make this clearer, the setter will now first attempt to use the
current_environment if it matches the given environment name, and will
explicitly raise an EnvironmentNotFound error if no matching environment
is found. The use of the current_environment with a matching name is
preferred over looking up a configured environment because there may be
no directory environment to load.
(PUP-2519) Test agent with directory environments enabled
(maint) Add environment review tests

PUP-2214 and PUP-2519 have resolved the remaining issues related to
non-existent directory environments and directory environment
configuration which were causing the directory environment acceptance
test to fail.  I'm including these three tests now as a baseline for
static, dynamic and directory environment behavior.
Merge pull request #2646 from jpartlow/issue/master/pup-2519-settings-create-environment-dir

Issue/master/pup 2519 settings create environment dir