(PUP-1118) Fetch the environment's manifest & modulepath at init

After trying to get the manifest and modulepath during the
initialization for an environment, it turned out that a lot of other
things depended on a very specific load order. Some of those needed to
change around, others needed to delay executing until later, after
everything had been loaded and initialized (creation of the root
environment was one of these). The reset of the Parser::Functions also
moved so that it doesn't happen until settings have been initialized.
(PUP-1432) Add V2 API structured errors.

This commit introduces error responses, a JSON object as described
in the api documentation (with associated schema).

It introduces the Puppet::Network::HTTP::Issues module, which collects
the known issue_kind values, in order to ensure consistency and provide
ability to yardoc them.

It adds two HTTPError subclasses for future use: an HTTPBadRequestError
(400 response), and an HTTPServerError class. The HTTPServerError
allows the API to provide more information about an unexpected error
than simply letting the error bubble up to be caught by the generic
HTTP handler.
(PUP-1432) Move JSON error ser8n to error classes

Rather than serializing in the generic HTTP handler.
(PUP-1432) Fix error JSON schema

The type of the items in the stacktrace array was not correctly
specified.
(PUP-1432) Add error spec that tests serialization
(PUP-1118) Introduce "create" to make specific environments

Environments are more than just a name, they are also a modulepath and a
manifest. This commit makes a "create" method for setting up
environments with specific modulepaths and manifests rather than relying
on the Puppet Settings at the time that methods are called. In order to
control environments for module installation they now take advantage of
this in order to control the modulepath that things will be installed
into.
(PUP-1118) Provide context at initialization for environments

When puppet is initialized it now also sets up a environments service so
that other parts of the code and go about their merry way.

This also changes the handling of component to work the same way as
other types so that an extra, and confusing, require isn't needed.
(PUP-1448) Validates the user type shell property

Adds the feature :manages_shell to the user type and asserts that
providers manipulating the shell property must have this feature.  The
useradd provider is then patched to specifically check that the shell
property is valid (file exists and is executable).  Other providers
which use shell (user/aix, user/directory_service, user/ldap, user/pw)
have the :manages_shell feature added to ensure that they continue to
function, but no additional validation is performed.

Rebased to a more recent master from Alejandro Ramirez's PR
https://github.com/puppetlabs/puppet/pull/1942
(Commits squashed)
(Maint) Alias TESTS as TEST

Sometimes we type one, sometimes the other. Just make them aliases.
(PUP-1118) Remove use of Environment.current

One does not simply change the current environment!

This replaces use of Environment.current= and Environment.current with
Puppet::Context.lookup(:current_environment). This uncovered a lot of
assumptions about what the current environment is at various times, such
as during startup before initialization. There is now a "bootstrap"
context that is setup as soon as possible which provides a basic setup,
once initialization occures this is overridden with another context that
is able to do more.
(PUP-1118) Move global context methods to Puppet

This moves the global context handling out of the Puppet::Context class
and onto the Puppet module, which allows Puppet::Context to be a more
generic, overridable context system. It also allows references to
context information to be a little bit shorter.

This doesn't tackle making settings information available in the
context, and so there might be a little confusion between Puppet[] and
Puppet.lookup.
Merge pull request #2265 from jpartlow/feature/master/pup-1448-validate-user-shell

(PUP-1448) Validates the user type shell property
(Maint) Mark new context methods private

Let's keep these private a while longer until they have settled down a
bit more.
(Maint) Unravel require of forge code

This changes it so that the puppet/forge file handles pulling in all of
the forge related code and thereby sidesteps all sorts of load order
issues.
Merge pull request #2271 from zaphod42/feature/master/pup-1118-implement-environment-directory

(PUP-1118) Introduce explicit environments
(maint) remove dead code in scope_spec

Commented out code was testing removed behavior. Removed comments.
(PUP-1166) Add better error message when turning on strict_variables

When turning on --strict_variables without also using --future parser
with the future evaluator, the raised error is an uncaught throw.
Now the error message is "Undefined Variable".
Merge pull request #2272 from hlindberg/pup-1166_better-error-for-strict-var-lookup

(PUP-1166) Add better error for 3x --strict_variables
Revert "Merge branch 'ticket/master/18342-windows-file-setting-owner-group'"

This reverts commit cf4501c7a97c106994c2ef81756c2081f56feeef, reversing
changes made to fcf482aa85708fe20f38cd96d6d92fc58ee78cf6.
Correct all misspelled instances of the word occurred