(#7749) Reduce weird scope cycles when bootstrapping settings

This commit is a first step towards cleaning up the way that settings
are loaded when puppet is bootstrapped.

A major symptom of the old load order was that if you do a 'require "puppet"'
too early in your code, everything will break because the defaults will
be screwed up.

This commit does not represent an ideal (or probably even a 'good') solution,
it just tweaks a few things in order to make a more meaningful cleanup
possible.

Specifically:

* Makes the ":mutable_defaults" class of settings more sticky, so that they
  are actually used when interpolating settings
* Simplify resolution of run modes for legacy application names; previous
  implementation required *ALL* available apps to actually be fully parsed
  and loaded in order to resolve these, and that introduced some challenging
  bootstrap dependency cycles.
Add lib_trollop.rb, an alternative implementation of an option / cli parser
(#7749) Parse command line args and config file before loading app/face

This commit is mostly focused on solving the following chicken-and-egg
problem: the way the code worked before, the command_line class would
try to load an app before doing any parsing of the cli args or the
puppet config file.  However, we want to support being able to load apps
and faces from the libdir... and if your libdir is in a non-standard
location, which you've specified via the command line or config file, then
the command_line class would fail to find any apps that were in your
libdir and exit before it ever even looked at the cli args or the config
file.

To get around this, and to prepare for supporting the ability to run
faces without an application stub, we needed to move the parsing of
the cli args and config file to an earlier point in the lifecycle.

The major changes in this commit are:

* Move the initial parsing of the cli args and the config file out of
application.rb and into command_line.rb so that they happen before
puppet tries to locate apps/faces.

* Remove all of the "should_parse_config" and "should_not_parse_config"
options and tests from the various apps.  These are not relevant any
longer because we always need to parse the config file to make sure
we know where the libdir is before we try to load faces / apps.

* Introduce a new option parser implementation, to supplement and
perhaps eventually replace our use of the Ruby stdlib OptionParser.
The stdlib OptionParser has some very undesirable behaviors that
are not configurable; the new PuppetOptionParser is a wrapper
around an open source parser called "trollop"; it maintains the
same API that OptionParser exposes, but gives us complete control
over what is happening behind the scenes.

Conflicts:

	spec/unit/util/command_line_spec.rb
(#7749) Improvements to handling settings, bootstrapping puppet

Major changes include:

* support multiple config files (/etc/puppet, ~/.puppet).  we no longer
use "run_mode" to determine the location of the config file.
* remove all references to application run_mode/state from defaults
* make the typing of settings a little more strict
* create a new setting type for directories, to make us a little less vulnerable to the terrible matching algorithm in FileSetting
(#7749) get rid of "set_run_mode" method in Application class

The "set_run_mode" method in the Application class made it a little
too easy to do dangerous / scary things to the main application
state during run time.  Get rid of this method and provide slightly
more controlled ways to accomplish the necessary goals.
(#7749) get rid of $puppet_application_name and $puppet_application_mode globals

This state is now handled via instance variables in the Settings class.
(#7749) rename "Settings#setdefaults" to "define_settings"

This is just to clarify the intent of the code, mostly in defaults.rb.
The old signature still exists, but prints a deprecation warning.
(#7749) doc / tests cleanup
Merge pull request #571 from puppetlabs/integration/master/7749-bootstrapping-puppet

(#7749) improve bootstrapping puppet to support pluginsync apps.
Add comment with URL of upstream pull request for trollop

Submitted a patch to the upstream trollop library, in hopes
that these changes will get included and we won't have our
own custom fork of the project.  Added this to the comments
for visibility.
Merge pull request #590 from cprice-puppet/cleanup/master/trollop_pull_request

Add comment with URL of upstream pull request for trollop