(PUP-1962) Fix class relationships

Fixes the following manifest: Class[foo] -> Class[bar]

Would fail with undefined local variable or method `host_class'
exception.
PUP-1975 Add environment information to facts save during compilation

Previously the save method on the indirector was called without including
the environment information. This patch includes the environment so a custom
terminus may utilize this information during storage.

Signed-off-by: Ken Barber <ken@bob.sh>
PUP-1975 Include transaction_uuid in facts terminus save during compilation

This includes transaction_uuid in the options sent to the save method for the
facts terminus.

Signed-off-by: Ken Barber <ken@bob.sh>
(PUP-1973) Fix getting scope vars to template for inherited scope

The change in PUP-1220 (turning off access to dynamic scope)
accidentally also turned off access to inherited scope.

This is a big problem because it blocks the most used pattern of getting
parameters into classes in modules (and then accessing them in
templates).
Merge pull request #2445 from hlindberg/pup-1973_fix-access-to-inherited-scope

(PUP-1973) Fix getting scope vars to template for inherited scope
(PUP-1279) Make Class[::p] remove the ::

When transformed to 3x to form a reference to a class, the 3x runtime
does not handle ::p (it expects the :: to have been removed), and
subsequently it is not able to find classes starting with ::.

This fix removes leading '::' when a PHostClassType is created.
Merge pull request #2446 from hlindberg/pup-1979_class-ref-with-absolute-name

(PUP-1279) Make Class[::p] remove the ::
(PUP-1978) Fix issues with [] operator error reporting

There were issues when errors where reported from using the [] operator
with LHS being a Type (Class, Resource) and the given keys were given
as an empty array (resulting in no arguments). The error reporting was
faulty in this case and blamed the wrong object. This resulted in the
error reporting logic to not find a source reference.

This also fixes the issue message text when min/max was the same value.
Merge pull request #2448 from hlindberg/pup-1978_class-resource-with-empty-name-list

(PUP-1978) Fix issues with [] operator error reporting
Merge pull request #2444 from kbarber/ticket/stable/pup-1975-add_environment-to-facts-save

PUP-1975 Add environment information to facts save during compilation
Merge remote-tracking branch 'upstream/stable'

* upstream/stable:
  (PUP-1978) Fix issues with [] operator error reporting
  (PUP-1279) Make Class[::p] remove the ::
  (PUP-1973) Fix getting scope vars to template for inherited scope
  PUP-1975 Include transaction_uuid in facts terminus save during compilation
  PUP-1975 Add environment information to facts save during compilation
  (PUP-1962) Fix class relationships
Merge branch 'master' of https://github.com/puppetlabs/puppet