(PUP-2752) Fix for invalid semvers

Prior to this commit the module tool would fail to perform any actions if any
module found in the modulepath had an invalid semver.
This commit warns about invalid semvers in installed modules, sets the version to
0.0.0, and moves on. This allows the module tool to continue to work, even with the
invalid semver found in the path. This commit also adds some rudimentary tests
for the Puppet::ModuleTool::InstalledModules class.
(PUP-2521) Remove windows-pr

 - Windows::Error no longer exists and the ERROR_FILE_NOT_FOUND
   constant is part of the Puppet codebase now.
 - Catch appropriate error in package specs
 - Remove windows-pr, win32-api and windows-api from gemspec
(PUP-2886) Add validation for reserved type names

Before this it was possible to name classes and defines with
words that are reserved by the type system (e.g. 'integer'), while
the name is not a type (Integer is a type, but integer is not), the
definitions will automatically create a resource type named with
an upper case initial letter, and will thus be difficult to reference.

For that reason it is better to error on these names statically.
(PUP-2732) Use less restrictive exec user validation

Without this patch Puppet agent validates the user attribute of exec resource that way, that it's fully unsupported if running without root user. Doing so, the following error message is printed and execution aborted:
"Only root can execute commands as other users". This patch ignores a given user to run the exec as if it's the same as the user actually running the Puppet agent process.
See https://tickets.puppetlabs.com/browse/PUP-2732 for more information.
(PUP-2920) Make PMT authenticate with forge and request extra modules.

Before this PMT only supported basic authentication which the Puppet Forge
does not. This adds the ability to configure other authentication
methods and request that forge include extra module groups in responses.
(PUP-1186) Ignore PAX header in tar unpacking

Prior to this commit if you installed a puppet module built on a platform with
a tar implementation that adds PAX headers and your platform didn't have a native
tar implementation (Windows), the module would contain junk PaxHeader directories.

This is due to the default POSIX behavior programmed in to minitar (the ruby tar
implementation used for platforms with out native tar) for an unknown typeflag,
such as those used in PAX headers, is to treat it as a regular file and extract it.

This commit adds a pre-scan step to our use of minitar for unpacking that finds
all the files with standard typeflags (0-7) and then only unpacks those, thus ignoring
any Pax typeflags like 'x' or 'g'.
(maint) Fix typo in comment
(PUP-2714) Support explicit creation of empty program

An empty program (one without any expressions except "no-op") did
not produce an instance of Model::Program. This is bad because it
is of value to get the lexed/parsed model with line references for
comment processing and other static analysis of the source.

Now, an empty program will produce a Model::Program containing a single
Model::Nop instruction. This instruction has offset at "EOF", and a
length of 0 (thus, any comments in the input source are guaranteed to be
placed before this nop.
(PUP-2757) Change Puppet::Resource default env to avoid duplicate
parsing.

When a Resource is used as a reference, it still needs to find its type
and will try to find it via known_resource_types in the environment.
Hence, if Puppet::Resource#environment produces the special environment
NONE when the resource is not contained in a catalog (as no references
by definition are) then, the NONE environment will need to be populated
and this triggers a duplicate initial_import).

This commit changes the default environment for a resource to be:

* the environment attribute if set
* the environment of the catalog it is contained in
* the current_environment if set
* the special environment NONE if the other two were not set

This also changes the '*root*' boot context to specify the manifest
to be NO_MANIFEST. This because the defaults otherwise may lead to
loading the entire source tree of puppet when running tests.
Merge pull request #2860 from adreyer/authentication

(PUP-2920) Make PMT authenticate with forge and request extra modules.
(PUP-2757) Force agent to use a remote 'reference' environment

Puppet application setup, shared by master, agent, apply and others,
would make use of a 'remote' environment (an environment object with nil
modulepath/manifest intended as a reference to the environment on a
master with content dictated by the master), but only when unable to
generate or locate the configured environment.

This commit rearranges the environment setup order slightly to better
ensure that an agent always initializes with a 'remote'
current_environment, unless the user has specifically overridden
--modulepath or --manifest for some painful and obscure reason.

During the Configurer run, we push the final remote environment onto the
context based on what the master has told us in the returned node.

The reason for all of these is so that an environment configured for a
local puppet apply does not taint what gets used during an agent/master
run.
Merge pull request #2749 from hlindberg/PUP-2714_handle-empty-program

(PUP-2714) handle empty program
Merge pull request #2842 from hlindberg/PUP-2886_reserved-type-names

(PUP-2886) Add validation for reserved type names
Merge pull request #2835 from Iristyle/ticket/master/PUP-2521-remove-windows-pr-gem

(PUP-2521) Remove windows-pr gem
(PUP-2824) Add errors for reserved parameter names

This adds validation of reserved parameter names; $name and $title
that, if they are used will cause problems later in the production
of a catalog.

The implementation performs the checks as part of validation of
the parsed puppet logic.
(maint) Remove unused index in iteration

This replaces a each_with_index with just each since the index
was not used in the logic of the internal_check_no_capture method
in the checker4.0.
Merge pull request #2873 from hlindberg/PUP-2757-avoid-loading-twice

(PUP-2757) Change Puppet::Resource default env to avoid duplicate
Merge pull request #2804 from hlindberg/PUP-2824_reserved-param-names

(PUP-2824) Add errors for reserved parameter names
Merge pull request #2827 from highb/fix/master/pup-2752_warn_on_invalid_semver

(PUP-2752) Fix for invalid semvers
(PUP-1471) Remove warning message about pausing Windows agent service

Puppet agent on windows now uses a win32-service gem which is 0.8.4 or
greater[1,2]. The warning message and inline comments are no longer
required now that the upstream bug was fixed[3].

[1] https://github.com/puppetlabs/puppet/commit/5a5e685bf835fb459d036d31f0078668f5802331
[2] https://github.com/puppetlabs/puppet/commit/784c3d17c4d3e666701559c529e46465e5dc417e
[3] https://github.com/djberg96/win32-service/commit/38eba9f1edee41c9fb1d89fc3dea11da0768baf9