(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.
Merge pull request #2556 from jpartlow/maint/master/fix-cmdline-overrides-environment-test

(maint) Don't overwrite mast_opts hash
(PUP-1799) Rewrap some longer comments
(PUP-1799) Clarify public/private portions of the Functions API

Moved attribute/parameter injection support and docs to the tail end of the
file, and marked api private.  Also went through and designated the
public methods of the Functions API (create_function(), and the methods
such as dispatch(), param() and so forth which may be used to build up
dispatching for a function).
(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.
(PUP-1060) Don't fetch latest versions at prefetch

In the previous implementation of yum .prefetch, package providers were
loaded and then the yumhelper.py script was used to determine the latest
versions available for all installed packages. While this worked for
simple cases, trying to support multiple combinations of enablerepo and
disablerepo flags makes this grossly more complex. In addition this
information is not needed at prefetch time, and testing the behavior in
prefetch gets messy.

This commit extracts the latest version query from the prefetch method.
It moves the logic to a method that does the actual querying and lazily
loads that data to keep the same run speeds. When multiple combinations
of enablerepo and disablerepo are added this information can be loaded
in the same fashion.
(PUP-1060) update yumhelper to handle {enable,disable}repo

In order to be able to use enablerepo and disablerepo flags while
ensuring latest, we need to be able to query for packages needing update
with a specific set of repos to enable and disable.

This commit updates yumhelper.py to take two flags '-e' for a repository
to enable, and '-d' for a repository to disable. The values given to
these flags must be a comma separated list of names with no spaces
between them.

It's unsustainable in the long run to continue extending this file, and
we should look very seriously at seeing what behaviors we can remove.
It's impossible to test this as-is and as we add more complexity we risk
introducing more bugs.

Original patch by Matthew Byng-Maddick.
(PUP-1060) Respect yum enable and disable repo flags

When a package resource is ensured => latest, the specific version
available will depend on what yum repositories are enabled and disabled.
Commit a4abf13d3 added the ability to pass arbitrary options to install
and update commands which allowed users to specify the --enablerepo and
--disablerepo options, but these flags would not be respected when the
latest package version was used. This meant that the latest version
found and the version that could be installed with the --enablerepo and
--disablerepo flags might differ, causing all sorts of bad things to
happen.

This commit resolves this issue by making the version query aware of
these flags. When a package checks for the latest version available, it
passes all repositories enabled and disabled to the update query.
Whenever an update query is made for the first time with a combination
of repositories that output is stored, so that only query for a given
combination of repositories is made.

Unfortunately, this change still relies on yumhelper to do the actual
querying. In the long run it would be good to use `yum check-update`
instead of the complex helper script so that we can actually test and
verify the code responsible for querying packages.
(PUP-1799) Add warning messages to docs

These APIs are still under development, but will be part of the next
release. This tries to give any users warning that they might change at
any time.
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
(maint) Reverting an unnecessary API change to Pupppet::Node::Environment

Previously, this branch would coerce arguments to Environment#initialize
into Symbols, permitting Strings to be used for names when creating new
environments.  This change rollsback the change that introduced that
behavior.
Merge pull request #2534 from hlindberg/pup-2190_lookup-meta-parameter

(PUP-2190) Fix issue when there are no defaults (for meta params)
(maint) Simplify yumhelper.py output parsing
(PUP-2080) Reinstate function as a QNAME

The 'function' word was accidentally made a literal value when the
function in the puppet language changes were removed. It should have
been a QNAME, since that is what bare words are. This allows it to once
again be used as the name of a class, for instance.
(maint) Fix typo
(maint) Remove reference to type factory

The type factory methods are no longer exposed in the function API.
There was a sentence that still refered to that however.
(maint) Mark Function impl public

The implementation base class for functions is public since it will be
needed by any function implementation.
(PUP-1799) Rename to InternalFunction

The InjectedFunction name wasn't very descriptive and also didn't
provide a good indication to external users that it shouldn't be
touched. This changes the name to InternalFunction.
Merge pull request #2562 from zaphod42/issue/master-pup-2080-function-is-a-qname

(PUP-2080) Reinstate function as a QNAME
(PUP-1799) Remove support for ruby types

The param specifications used to allow using the ruby types in addition
to strings specifying the puppet types. This made it hard to explain the
API as well as probably would lead to some surprises since the
translation from the ruby types to the puppet types is not always the
most straightforward.

In order to just side step all of those problems, this simply removes
that support.

In addition it pulls out the construction of the type parser so that it
is held on to for the entire function creation.