(PUP-2757) Change Puppet::Resource default env to avoid duplicate
parsing.

When a Resource is used as a reference, it still needs to find its type
and will try to find it via known_resource_types in the environment.
Hence, if Puppet::Resource#environment produces the special environment
NONE when the resource is not contained in a catalog (as no references
by definition are) then, the NONE environment will need to be populated
and this triggers a duplicate initial_import).

This commit changes the default environment for a resource to be:

* the environment attribute if set
* the environment of the catalog it is contained in
* the current_environment if set
* the special environment NONE if the other two were not set

This also changes the '*root*' boot context to specify the manifest
to be NO_MANIFEST. This because the defaults otherwise may lead to
loading the entire source tree of puppet when running tests.
(PUP-2757) Force agent to use a remote 'reference' environment

Puppet application setup, shared by master, agent, apply and others,
would make use of a 'remote' environment (an environment object with nil
modulepath/manifest intended as a reference to the environment on a
master with content dictated by the master), but only when unable to
generate or locate the configured environment.

This commit rearranges the environment setup order slightly to better
ensure that an agent always initializes with a 'remote'
current_environment, unless the user has specifically overridden
--modulepath or --manifest for some painful and obscure reason.

During the Configurer run, we push the final remote environment onto the
context based on what the master has told us in the returned node.

The reason for all of these is so that an environment configured for a
local puppet apply does not taint what gets used during an agent/master
run.
Merge pull request #2873 from hlindberg/PUP-2757-avoid-loading-twice

(PUP-2757) Change Puppet::Resource default env to avoid duplicate