(PUP-1118) Add check for getting multiple environments

The acceptance test now checks for getting multiple environments listed
from the environmentsdir
(PUP-1118) List environments from a directory

This starts the process of creating a Puppet::Environments::Directory
that will find environments from a particular directory. The directory
has sub-directories, where each sub-directory name is the environment
name.
(PUP-1118) Load full environments from a directory

This changes the loader used by the code to list environments to be a
composition of the legacy environments and the new directory
environments.
(PUP-1118) Simplify Puppet::Context

Puppet::Context can reduce the number of objects that it uses for
tracking contexts by keeping everything internal to it. This actually
results in much less code, but a few more instance variables to track.
Overall is seems like an easier to understand system.
(PUP-1118) Create a new context after app initialization

There end up being 3 steps of initialization in puppet:
  * bootstrap: after code starts loading, but before initialize_settings
    is called
  * initial: after initialize_settings is called, but before an
    application has been loaded and sets up the true run mode
  * application: after an application has started running, set the run
    mode, and reinitialized the app default settings.

This last one had been missed in previous changes to have puppet setup
the right contexts. This now setups another context override in the
Puppet::Application run method to control the application context.
(PUP-1118) Make environments readable by puppet master

The directories that were made for the environment listing tests were
not actually readable by the master. This changes them to be readable.
(PUP-1118) Document Puppet::Environments

This also creates two new rake tasks for generating the documentation:
doc:api and doc:all. The doc:api is to generate the published docs,
which omits portions of the code that hasn't been tagged. doc:all just
outputs everything.
(PUP-1118) Move root environment to Context

And adjust TestHelper initialization to preserve base context setup
without requiring settings initialization in before_all_tests hook.

Initializing settings in the before_all_tests was causing a slowdown
somewhere in call_hooks_deferred_to_application_initialization.

The issue came from the root environment needing to have the modulepath,
which interpolates in the confdir to produce the value. However,
after an initial run, the after each hook tears down the settings, which
makes them unavailable in the second before all call. This problem had
been masked previously because of the way the root environment was
cached and not reset between tests.
(maint) Only load yard tasks if yard is available
(PUP-1151) Respond with 404 when path not known

The v2.0 api implementation had a type that was not caught by any tests.
This fixes that issue (a typo) and adds a test that would have shown the
problem.
(PUP-1387) fixes wrong hash in subjectKeyIdentifier

this fixes the regression that appeared when the arguments to
ExtensionFactory where accidentally swapped.
Also added a test case to check if the subjectKeyIdentifier is present.
(maint) expand ExtensionFactory creation for clarity

The code compression in 94345ebac introduced a regression where the
issuer certificate and subject certificate were transposed, which would
cause erroneous extensions to be created. db5fb8a fixed this issue but
it's still pretty unclear why the given values are set. This commit
removes the code compression so that we specifically call out the
behavior of adding extensions to a self signed cert.
(doc) Document certificate_factory methods

Any code dealing with X509 is rather difficult to understand by default,
and methods that have no documentation don't help. This commit expands
method documentation for future generations that are brave enough to
delve into this code.
Merge branch 'pull-2237'
(PUP-1118) Ensure there is only one *root*

If there are multiple root environments ever created, then functions
that belong on the root do not get registered correctly. This stops that
by making sure that the root is only created during the bootstrap phase.
Merge pull request #2297 from zaphod42/issue/master/pup-1151-error-when-generating-404-response

(PUP-1151) Respond with 404 when path not known
Merge pull request #2296 from zaphod42/feature/master/pup-1118-implement-environment-directory

(PUP-1118) List environments from a directory
Merge branch 'master' of https://github.com/puppetlabs/puppet