Revert "Merge branch 'revert/3.x/faces_from_modulepath' into 3.x"

This is a "revert-the-revert" commit.

This reverts commit 87ea7a8849f90a232f2bb683fb8a2ce1573a21db, reversing
changes made to 8dff14b9c5a3cdd99ede63dbcbb2dbe00b457926.
(#15214) Remove confdir and vardir from run_mode

Prior to this commit, the vardir and confdir settings were tied to
run_mode.  This caused a chicken-and-egg problem where you could not
initialize the confdir and vardir until you'd loaded the
application/subcommand, because that is the first point in time where
you'd know the run_mode.  However, without knowing the confdir/vardir
ahead of time, it's impossible to know where all you might need to look
to try to find the application/subcommand for loading.

This commit decouples those settings from run_mode.  The default values
for them are now set solely based on whether the user is root or not.
Individual applications may override these defaults a bit later in the
life cycle (e.g., 'master' does this).

Conflicts:
	lib/puppet/settings.rb
	lib/puppet/util/autoload.rb
	lib/puppet/util/run_mode.rb
	spec/unit/util/run_mode_spec.rb
(maint) Fix Failed to load face errors

Without this patch applied Telly will spew out a bunch `Error: Failed to
load face foobar` errors when `puppet help` is run.  These errors look
like:

    Error: Failed to load face help:
    no such file to load -- puppet/face/0.0.1/help
    Error: Failed to load face ca:
    no such file to load -- puppet/face/0.1.0/ca
    Error: Failed to load face catalog:
    no such file to load -- puppet/face/0.0.1/catalog
    Error: Failed to load face certificate:
    no such file to load -- puppet/face/0.0.1/certificate
    Error: Failed to load face certificate_request:
    no such file to load -- puppet/face/0.0.1/certificate_request
    Error: Failed to load face certificate_revocation_list:
    no such file to load -- puppet/face/0.0.1/certificate_revocation_list
    Error: Failed to load face config:
    no such file to load -- puppet/face/0.0.1/config
    ..etc.. for each face, but then see the regular help output.

The problem is that the regular expression changed in a previous patch
in my #7316 work, causing load errors resulting from checking for
version specific faces to pass through the exception handler.

This patch fixes the problem by tightening up the regular expression to
catching both version specific faces and "current" face load errors.

The `Puppet.debug` statement is also wrapped inside of a conditional so
that we don't log spam and we can accurately see if we're actually
loading multiple times or not.  The expectation is that `require` will
only load the file once and return false on subsequent calls.
Merge branch 'fix/3.x/7316_load_faces_from_modulepath_try3' into 3.x

* fix/3.x/7316_load_faces_from_modulepath_try3:
  (maint) Fix Failed to load face errors
  (#15214) Remove confdir and vardir from run_mode
  Revert "Merge branch 'revert/3.x/faces_from_modulepath' into 3.x"
Merge branch '3.x'

* 3.x:
  (maint) Fix Failed to load face errors
  (#15214) Remove confdir and vardir from run_mode
  Revert "Merge branch 'revert/3.x/faces_from_modulepath' into 3.x"
(#16221) Make undef not override default parameters

In 2.7.x, passing undef as an argument to a parameterized class will result in
the argument using the default value given in the class definition. This was
inadvertently changed, so the variable would not be set at all. This change
reverts to the 2.7.x behavior.
Extract methods from set_default_parameters and improve test coverage

Refactor the set_default_parameters method in Puppet::Resource to be split
into several methods and improve the test coverage around default parameters
and undef.
Merge branch '3.x'

* 3.x:
  Extract methods from set_default_parameters and improve test coverage
  (#16221) Make undef not override default parameters