(#22744) Filter virtual resources in the static compiler

Previously (on Lost), the static compiler was directly creating and
invoking the regular compiler and then modifying the file resources to
get the desired behavior. Because the static compiler was directly
invoking the regular compiler, it was not invoking all the methods that
would normally get called when the regular compiler was called by the
indirector.

This commit resolves this problem by making the static compiler inherit
from the regular compiler instead of delegating to the compiler. If
there are future changes to how the indirector invokes termini, the
static compiler will still be able to generate catalogs in the same
manner as the regular compiler.

Original patch by Chris Spence <chris.spence@puppetlabs.com>
(PUP-1099) Fix incorrect permissions in RPMs

The RPM spec template uses extremely restrictive permissions for `log`
and `lib` directories. These permissions were being incorrectly applied to
`examples` during packaging. This corrects that problem by resetting
default attributes after restricting `log` and `lib` directories.
(pup-546) Remove hiera2 support from binder

This removes hiera2 support from binder.
Tests are updated to use ruby based bindings for the same data bindings
as the removed hiera2 based bindings.
(pup-546) Remove automatic injector lookup for class parameters.
(pup-546) Remove hiera2.rb (central file with require's for hiera2)
(pup-546) Update default.rb and remove mention of hiera2

The documentation for the --binder setting is updated to reflect
that hiera2-data-in-modules is no longer loaded, while still allowing
bindings to be made in ruby, now referred to as "bindings in modules".
(PUP-546) Replace lookup function with something useful

With removed hiera2, the lookup function is not as useful and is
now replaced with the lookup from (#22574) which first looks in
bound data and then in hiera.

The intent is to use the technolgy agnostic "lookup" in the future
parser/evaluator to enable shorthand notation. The actual lookup
mechanism/technology is thereby not visible to the user.
(maint) Windows file provider :links => :follow

 - Previously, the Windows file provider would raise an error when
   applying a catalog that contained file resources with `:links =>
   :follow`, when the given path was not actually a symlink
 - The behavior of readlink is essentially correct, as File.readlink on
   other operating systems yields Errno::EINVAL: Invalid argument
 - Therefore the appropriate behavior to match Puppet on other
   platforms is to behave like File.chown, which will operate on the
   link IFF it is one, or will operate on the file / dir directly if it
   is not a link
 - Corrected a minor issue in the creation of the error msg raised
   by the Windows implementation of readlink
(PUP-546) Fix problems with lookup after removal of hiera2

Moved lookup functionality to separate helper class.
(PUP-665) Don't call hooks unless absolutely necessary

Calling hooks on configuration settings that don't have them forces the
code to interpolate any `$variable`s in the value of the setting. There
are a couple places where the hooks are called before everything has
been fully prepared (such as in initialize_global_defaults) and so run
mode settings such as confdir are not available.

This restores the old behavior in which only settings with hooks will
end up going down this path. This doesn't fully address the problem, but
it does make the surface area much smaller.
Merge pull request #2178 from zaphod42/issue/master/pup-665-interpolating-variables-too-early

(PUP-665) Don't call hooks unless absolutely necessary
Merge pull request #2171 from mckern/ticket/stable/PUP-1099

(PUP-1099) Fix incorrect permissions in RPMs
Merge branch 'stable'

* stable:
  (PUP-1099) Fix incorrect permissions in RPMs
(PUP-1133) Windows tests write config to temp

 - Previously tests were writing to the shared
   %ALLUSERSPROFILE%\PuppetLabs\puppet directory, and would blow
   up if this directory did not exist
 - Because this directory was shared from one run to the next, failing
   tests could be masked by data generated / used by a locally installed
   Puppet
 - The stubbing of FileSystem::File.exist? to return true was causing
   some tests to treat files like c:\dev\null\foo to attempt to be
   loaded, which would cause these tests to fail in isolation, but not
   when run within the suite
 - Had to change some doc specs under Ruby 1.9 / OSX to verify a value
   instead of asserting a method was called, to prevent a stack overflow
 - In some unit tests, the process of reading / writing settings caused
   issues with test loading, so Puppet.settings.use has been stubbed
(PUP-1133) Reset permission on Windows test files

 - Previously some security tests manipulated file permissions in
   a way that made it impossible for the top-level spec temp file
   cleanup to be performed.  This patch resets the files after runs.
(PUP-1133) Clean up leftover parser generate temp

 - Files were created without going through tmpfile as they needed
   specific extensions
(PUP-1133) Cleanup Windows symlink

 - Windows symlinks, when targeted at directories, do not get cleaned up
   if not unlinked, even when going through the global tmpfile
Merge branch 'pr/2176'

* pr/2176:
  (maint) Windows file provider :links => :follow
(maint) Provide option to 4x->3x convert to handle :undef differently

Functions requires :undef conversion to '', while other parts
require :undef (verbatim). This changes the signature of the convert
method to accept the value to use when :undef is encountered.
(PUP-798) Add call to watch_files to ensure reparsing

This adds a call to watch_file in the code path for the future
parser/evaluator at the same place such call is made in the 3x
implementation. 

The ParserFactory is given an environment, and when this is 
a real environment, its known_resource_types are given to the parser
adapter being created to allow it to make the call to watch_file.