(maint) checksum methods should be class methods

Before this change, using a checksum algorithm required creating a class
and including the Checksums module. Since there's no state required for
the checksum methods, this was a silly thing to need to do.

This commit makes the module extend itself, so that the methods can be
invoked by doing `Puppet::Util::Checksums#method`.

In the long run, this module should use the `module_function`
declaration so that the checksum methods are private when included.
(PUP-1840) Add a digest_algorithm Puppet setting, defaulting to md5

Without this patch applied, Puppet only performs checksums of files
using the MD5 algorithm. MD5 is not available on hosts configured for
FIPS 140-2 compliance, so Puppet fails. This patch adds a setting,
settable in puppet.conf, whose name is digest_algorithm and whose
value can be any checksum type known to Puppet::Util::Checksums. The
setting indicates which digest algorithm should be used for performing
checksums. (This patch does not contain the code that pays attention
to the setting.) The value defaults to md5, so that if you do not set
this setting yourself, Puppet will act like it always has before.
(PUP-1840) Ease testing under different digest_algorithm settings

Without this patch, spec tests for pieces of the code having to do
with checksums would have to be duplicated twice and contain repeated
code.

The patch adds the `using_checksums_describe` method, which can be used
instead of the `describe` method to enclose spec tests where checksums
are involved. This method only defined inside describe blocks where the
`:uses_checksums => true` user metadata is given, to mitigate the risk
of unintended changes to the behavior of spec tests not having to do
with checksums.

`using_checksums_describe` defines a group of examples, each having the
given block as body. Each example happens with a different value set
for `digest_algorithm`. Many `let`s are defined for use inside the
spec test; foremost are `plaintext`, `checksum`, and
`algo`. `plaintext` is some text; `checksum` is the checksum for this
text under the present setting of `digest_algorithm`. `algo` contains
the name of the digest algorithm in use.
unset, `algo` is 'md5'.

Code restructured and simplified by Adrien Thebo <adrien@puppetlabs.com>
(PUP-1840) Respect digest_algorithm in file metadata

Original code implemented by Jared Jennings <jared.jennings.ctr@us.af.mil>
(PUP-1840) Respect digest algorithm in filebucket file

Original code implemented by Jared Jennings <jared.jennings.ctr@us.af.mil>
(PUP-1840) Respect digest algorithm in filebucket dipper

Original code implemented by Jared Jennings <jared.jennings.ctr@us.af.mil>
(PUP-1840) Use configured digest_algorithm as default checksum_type for file resources

Without this patch, file resources will always try to checksum
themselves using MD5. On FIPS 140-2 compliant hosts, this will
fail. This patch adds sha256 as a permissible value for the File
resource's checksum parameter, and makes the checksum parameter
default to using the digest_algorithm, as set in the puppet.conf.
(PUP-1840) Use single location for default digest algorithm
(PUP-1840) Remove use of "use"

Puppet.settings.use isn't needed in these areas of code and we can rely
on the setting having a value. Also by putting the validation on the
setting itself no other areas need to validate it.
(PUP-1840) Remove unused constant

There isn't any need for the DEFAULT_DIGEST_ALGORITHM anymore since
everything can use the setting.
(PUP-1840) Remove magic variables from shared context

Putting these values in shared context just makes it harder on any
readers to track them down later. They are only used in 2 places and so
can be put there.
(maint) Remove redundant and useless tests

Some of these tests were preserved simply because they are there. On
closer inspection many were not needed because either they tested
functionality that simply doesn't exist (and it isn't very useful to
state that the functionality doesn't exist), stated the condition
incorrectly and misleadingly, or are handled in other places.
(PUP-1840) Use module methods of Puppet::Util::Checksum

Rather than mixing in methods that are then looked up we can make the
code a little more readable by clarifying that it is getting methods
from Puppet::Util::Checksum.
(maint) replace `using_checksums_describe` with `with_digest_algorithms`
Merge pull request #2537 from adrienthebo/feature/master/pup-1840-tunable-digest-algorithm

Feature/master/pup 1840 tunable digest algorithm