(PUP-2924) Initialize resources from Type classes

This patch extends the signature of `Puppet::Resource#initialize` to accept
subclasses of `Puppet::Type` as arguments. This allows `resource_type` to be
set during initialzation for some cases and eliminates a later, costly, call to
`environment.known_resource_types`.
(PUP-2349) Treat mode strings as octal

Previously there was logic to convert incoming mode using to_i,
but if it were a String that would convert the string as decimal,
whereas mode is always specified as octal. I don't know why the
to_i conversion was in there and whether it ever worked in a
meaningful way.

So fix this to convert Strings as octal.
(PUP-2349) Specify mode as a string containing an octal mode

Previously, mode was specified in some places as a Fixnum, in others
as a String. Consistently specify mode as a string containing octal.
(PUP-2349) Add deprecation warning for non-string mode property values

The 'future' (4.x) parser treats literal numbers as actual numbers instead of
strings as the 3.x parser did. This makes file resources that use unquoted
mode values behave strangely (see PUP-2156) so we are deprecating non-String
values for mode.

So this change adds a deprecation warning for non-String values of mode
when running with --parser future.
Merge pull request #2964 from kylog/issue/pup-2349/deprecate-non-string-modes-on-file-type

Issue/pup 2349/deprecate non string modes on file type
Merge pull request #2979 from Sharpie/pup-2924-resource-new-types

(PUP-2924) Initialize resources from Type classes
(PUP-3030) Refactor 'store' report to use replace_file

There was some logic in the 'store' report processor that was
almost identical to the logic in 'puppet/util.rb''s 'replace_file'
method.  This commit refactors 'store' to re-use the existing
logic.
(PUP-3030) Port Util#replace_file to use our Tempfile

This simply changes the `replace_file` method to
use `Puppet::FileSystem::Tempfile`, rather than the
Ruby built-in `Tempfile`.  This will allow us to have
a bit more control over the lifecycle of these files
on the server.
(PUP-3030) Port P::U::Execution to use our Tempfile

This commit ports Puppet::Util::Execution over to use our
alternate implementation of Tempfile.  This will allow
us to have more explicit control over the life cycle of
these files on the server.
(PUP-3030) Flesh out implementation of P::F::Tempfile

This commit changes `Puppet::FileSystem::Tempfile` so that
it no longer subclasses the built-in `Tempfile`.  The goal
here is to give us more control over the life cycle of the
files when used on the server.

The implementation is based on the Ruby 1.9.3 implementation of
`Tempfile`, but strips out some things like the finalizer
and methods that we don't need / use.

Note that we had to also port over a few methods from `Dir` in
order to support ruby 1.8.7.  Relevant source code is here:

https://github.com/ruby/ruby/blob/v1_9_3_547/lib/tempfile.rb
https://github.com/ruby/ruby/blob/v1_9_3_547/lib/tmpdir.rb

In its current incarnation the class is probably poorly
named because it no longer makes any attempt to automagically
unlink the file at some point in the future.  I intend
to submit a follow-up commit that renames the class to make
this more obvious.
(PUP-3030) Rename P::F::Tempfile to Uniquefile

Since the new implementation of Puppet::FileSystem::Tempfile is
not trying to manage the deletion of files created through it,
the name was misleading.  This commit simply changes the name
to Uniquefile to try to make it a bit more obvious that it is
not responsible for deleting the files.