(PUP-1976) Use metadata.json as canonical metadata source.

Prior to this commit, the Modulefile was used as the primary source of user-facing metadata for modules.  This file was executable Ruby, which was intended to describe a simple data structure.  This causes a few problems for us in the long-term, including making automated module builds a significantly more difficult proposition, and making changes to acceptable metadata a slow process (requiring new releases of Puppet).  In addition, the only piece of Puppet code that interacted directly with the Module file was the `module build` action – anywhere we actually need to know something about the module, we look it up from the metadata.json file.

This commit removes this level of indirection between user input and module data, making the metadata.json file a first-class citizen in Puppet modules.  It similarly deprecates the Modulefile as a supported source of module data.  Checksums have also been moved into their own file (per PE-3124), and `puppet module changes` has been updated to leverage the new file when available (per PE-3120).

For users building a module containing only a Modulefile, this will issue a warning that the Modulefile is deprecated, and output the corresponding metadata.json file.

For users building a module containing both a Modulefile and a metadata.json file, this will issue a warning that the Modulefile is deprecated and is being ignored.
(PUP-1977) Update `puppet module generate` to create `metadata.json`

Prior to this commit, running `puppet module generate` would create a Modulefile with the appropriate metadata, from which a metadata.json file would be generated when you ran `puppet module build`.  Since we're migrating away from the Modulefile as the canonical source of metadata (as per PE-3117), this commit will instead generate an equivalent metadata.json file when the module is created.
(PUP-2093) Integrate a dedicated dependency resolver.

Prior to this commit, we relied on the Forge's /v1 API to handle dependency
resolution for us; as we move away from that (now outdated) API, we will need to
take responsibility for that functionality in our own codebase.

This change vendors our own dependency resolver, as a stopgap measure. This is
not expected to be reused by consumers of Puppet, and will be deprecated and
removed from this codebase when the dependency resolver is properly published.
(PUP-2093) Migrate PMT to /v3 API.

Prior to this commit, the PMT managed all communication with the Forge via the
(now legacy) /v1 API. That API has been deprecated (primarily due to scalability
concerns), which is less of an issue since it was never officially a public API.

This commit migrates all communication to the Forge to the new /v3 API, which is
expected to be launched as our official public API "soon". This commit also
integrates a standalone dependency resolver, as the /v3 API contains no implicit
dependency resolution (as the /v1 API did); consequently, large portions of the
PMT code have been changed, and others have become unreachable.

This commit also changes the default host that the PMT communicates with, from
https://forge.puppetlabs.com to https://forgeapi.puppetlabs.com (the natural
URL for the Forge API service). Since the tool now expects to communicate with
a completely different service, it will be unable to communicate with services
that do not implement the same /v3 API.
(PUP-2093) Restore use of JSON (over PSON).

In master, we've officially introduced a dependency on the JSON library,
but the previous commit in this branch unintentionally reverted a part
of that commit due to merge conflicts.

This commit restores the use of the JSON library where it had been
previously removed.
(PUP-2093) Support hyphenated module names as dependencies.

In master, hyphenated module names are supported (effectively)
everywhere except as the name of a dependency. A previous commit in this
branch attempted to alleviate that situation, but failed to adequately
test the change and its implications, and potential failures existed.

This change introduces a change to existing tests that triggers the
offensive behavior both in master and in this branch, and refactors the
implementation to apply the necessary transliteration in all required
locations.
(PUP-2284) Add an interview to the PMT `generate` action.

Prior to this commit, when you generated a new module, it created a simple
metadata.json file with the same standard defaults for every module.  Since
JSON may not be the most familiar language for all of our users, we now do
some work up front to pre-fill that JSON file with useful data based on user
input.
(PUP-2285) Integrating the recommended README template

Prior to this commit, `puppet module generate` would create a simplistic
README file for the new module.  This change integrates the README
template we publicly recommend people use to document their modules
(http://docs.puppetlabs.com/puppet/latest/reference/modules_documentation.html).
(PUP-2291) Fix absent priorities in yumrepo

The recent changes in puppet 3.5.0 have broken the ability to set the
priority of a yumrepo as absent.

This commit fixes that.

yumrepo{
    'foo':
        priority => absent,
}
(pup-2292) stronger tests on yumrepo's properties

When you set => absent on a yumrepo property, the result is a string in
ruby. However, it happens that we expect only a :symbol there in the
tests.
(PUP-2093) Improve documentation and test names.

Prior to this commit, there were a number of places where documentation
was missing and test names were insufficiently descriptive.  This commit
adds additional clarity around those places, and makes a couple of code
clarity changes as well.
(PUP-2093) Migrate all PMT code to use JSON.

Prior to this commit, there were scattered bits throughout the PMT code
that still lived under the tyranny of PSON.  Since we've now officially
adopted a dependency on the JSON gem everywhere, our code should run
free and flourish in the new world, where JSON processing is handled
through a less ridiculously named constant – this change fully realizes
that new world for the PMT.
(maint) Fix documentation of Puppet::ModuleTool.environment_for_options

This method was erroneously documented as returning `void`.
(PUP-2278) Accept paths with spaces in PMT tarball interactions.

Prior to this commit, if the module_working_dir or the path to a module
being built contained whitespace, our simple string-interpolation
would fail to create a valid call to `tar` or `gzip`.  This change fixes
the bugs resulting from that behavior.
(maint) Refactoring module name validation to be less obtuse.

Previously the code that validated module names took a pessimistic
approach, validating conformance only to assert unrelated non-conformance.
As it turns out, this is messy to read and understand, so this change
rewrites the logic in a more straightforward manner.
(maint) Use PuppetSpec::Files for tmpdir creation in tests.

Before this change, the PMT Checksummer spec was using the in-built
'tmpfile' library directly.  For conformance with the rest of the test
suite, it's been recommended that we should use PuppetSpec::Files for
that functionality (which this change implements).
(maint) Fix metadata validation for missing namespaces and module names.

Prior to this commit, validation would raise non-sensical validation
errors if you attempted to validate a module name that contained a
separator (either '-' or '/'), but less than one character on either
side.  This change adds validation for those cases.
(PUP-2278) Parameterize the mode of Puppet::Util::Execution.execpipe.

In the previous commit, the default behavior of `execpipe` was changed
to ensure that the pipe was always opened in read/write mode.  While we
aren't aware of any regressions this change would cause, the cautious
route is to maintain the same default behavior for now; to that end,
this commit adds a `mode` parameter to `execpipe`, allowing callers to
choose the mode the pipe is opened in.
(PUP-2306) Force return type of generate to String

When Puppet::Util::Execution.execute was changed to return a subtype of
String in order to retain return code information, some callers ended up
breaking. This is because they made the assertion that types were
exactly the String class, rather than a subtype of String. There is also
the issue that only the primitive data structures should probably be
returned from puppet functions in order to not leak complex objects into
the puppet language and have hard to track down issues arise.

This changes the generate() function to force it to return a String of
the command's output.
Merge remote-tracking branch 'upstream/master' into PE-3182

Conflicts:
	spec/unit/face/module/install_spec.rb
	spec/unit/face/module/list_spec.rb
	spec/unit/face/module/uninstall_spec.rb
	spec/unit/module_tool/applications/installer_spec.rb
	spec/unit/module_tool/applications/uninstaller_spec.rb
	spec/unit/module_tool_spec.rb