(PUP-3391) Plugin synced for incorrect environment while agent is resolving environment

Before this commit if an agents environment was changed the plugins from
the initial environment were synced instead of the plugins from the
environment where the node would end up. This would cause problems where
a manifest from one environment would be applied with custom types and
providers from a different environment.

This commit changes the behavior to sync plugins after every environment
resolution. We need to sync the plugins after every environment change
because this action needs to be performed before we can retrieve a
manifest for the node in a particular environment.
(PUP-3591) Refactor get_facts to always return a hash

Configurer#get_facts would return either nil, or a Hash, forcing the
main run_internal method to guard its result. I've changed this to
return an empty hash instead of nil for consistency, allowing us to
remove a bit of duplicate code.
Merge branch 'issue/stable/pup-3591-cherry-pick-fix-from-master' into stable

* issue/stable/pup-3591-cherry-pick-fix-from-master:
  (PUP-3591) Refactor get_facts to always return a hash
  (PUP-3391) Plugin synced for incorrect environment while agent is resolving environment
(PUP-3627) Remove ignored certdnsnames setting
(trivial) Fix spelling mistakes in comments
https://github.com/vlajos/misspell_fixer
Merge pull request #3268 from vlajos/typofixes20141102

typo fixes - https://github.com/vlajos/misspell_fixer
(PUP-3564) Fix spec for ruby 1.8.7

Commit 49c5dab679 added a spec test that fails on ruby 1.8.7, because
ruby will automatically de-arrayify the single element array producing a
string, which doesn't match the expectation.

This joins the cert warnings so that we're explicit about the type of
argument.
Merge pull request #3280 from kylog/issue/remove-ignored-certdnsnames-setting

(PUP-3627) Remove ignored certdnsnames setting
(PUP-3604) Rework handling of :ensure with a version
Merge pull request #3266 from jasperla/openbsd/package_ensure

(PUP-3604) Rework handling of :ensure with a version
(maint) Fix acceptance test using cached catalog

The enc_nonexistent_directory_environment.rb was failing when it
attempted to run but was using a cached catalog instead of failing
without running a catalog like the test had intended.

This commit uses the -t command on the agent run instead of using all of
the flags that were being used.
(maint) fix production-created acceptnace for passenger systems

Passenger doesn't start up a master process until it's required.
Issue a curl to an endpoint to spurn passenger to startup the master
before testing if the production directory has been created.
Merge branch 'stable'

* stable:
  (maint) Fix acceptance test using cached catalog
  (PUP-3591) Refactor get_facts to always return a hash
  (PUP-3391) Plugin synced for incorrect environment while agent is resolving environment

Conflicts:
	acceptance/tests/environment/enc_nonexistent_directory_environment.rb
Merge pull request #3285 from er0ck/maint/master/fix-production_environment_created_when_missing-passenger

(maint) fix production-created acceptnace for passenger systems
(PUP-3436) Optimize CPU intensitive Compiler methods

This commit contains some performance optimizations in methods
that showed up as very time consuming in the profiler when running
the rake following rake tests:

benchmark:many_modules:run
benchmark:defined_types4:run
benchmark:defined_types:run

CPU consumption with this patch in place is between 70% - 75% of
what it used to be.

Profiling was performed using stackprof
https://github.com/tmm1/stackprof
(PUP-3436) Add optimized copy-constructor for Resource.

The Resource::copy_as_resource first created a new Resource
instance with all bells and whistles which means extracting
title, munching, and tagging. This commit ensures that these
fields are more effiently initialized when the source is
known to be a Resource.
(PUP-3436) Prevent unnecessary copying of tag sets.

This commit removes an unnecessary cloning of a tag set in the method
Puppet::Parser::Resource#add_scope_tags. It also removes unnecessary
processing of the tags since they have undergone this processing
already.