(PUP-3370) Remove serialization support from indirector request

Support for serializing/deserializing indirector requests was added per
Redmine issue #7080, but was never fully fleshed out and is a rather
sketchy idea in the first place. This commit removes all serialization
logic from Puppet::Indirector::Request.
(PUP-3300) Remove extend self from Checksums

This commit modifies Puppet::Util::Checksums to not extend self anymore
to move to using module_function.
(PUP-3289) Remove deprecated catalog_format and dynamicfacts settings

This commit is part of the Puppet 4 code removal effort.
Merge remote-tracking branch 'upstream/pr/3230'

* upstream/pr/3230:
  (PUP-3370) Remove serialization support from indirector request
Merge pull request #3232 from whopper/pup-3289/removal/cat_format-dynfacts

(PUP-3289) Remove deprecated catalog_format and dynamicfacts settings
Merge pull request #3231 from demophoon/refactor/master/pup-3300-checksum-refactor

(PUP-3300) Remove extend self from Checksums
(PUP-2289) Fix host type newline validation

This commit fix the first bug reported on PUP-2289.
This is done by implementing validation of newlines
on ip, hostname, comments and host_aliases, making
sure we don't have any \n or \r.

The bug and fix is on host resource type.

Below is the problem description:

If the ip address or hostname or host_aliases
use double quoting and have \n, Puppet Will:

1 - Write the wrong entry on /etc/hosts with the linebreak.
This leads to a corrupted /etc/hosts, with some lines
that could not be parsed by the host resource provider
parsed.

This leads to second bug on the second puppet run,
where it will have error after failing to parse the file,
but wipes out the /etc/hosts file, writing only the information
on that file that is managed by puppet.

How to reproduce it:
1- backup /etc/hosts
cp /etc/hosts /etc/hosts.orig
2 - Create the script to reproduce the bug 01
cat <<EOF > /tmp/hostsbug.pp
host {'hostsbug': ip => "10.10.12.1\n" }
EOF
The same apply if you have newline on hostname, hostaliases or comment.
3 - Run the script the first time to reproduce bug 01.
puppet apply /tmp/hostsbug.pp
4 - Check /etc/hosts
cat /etc/hosts

Leonardo Rodrigues de Mello

PUP-2289 Fix bug on host resource provider

The host resource provider parsed file wipes
all entries of etc/hosts file if it gets one
entry that could not be parsed.

This commits fix this problem, considering that
incomplete lines are :text_lines. This is the same
solution that was used for mount resource provider.

I  had checked that etc/hosts ignores invalid entries
at least on linux, tested on rhel 5, 6, 7 and debian 5,6,7 and
fedora 20.

It would be great if someone could test it on other platforms.

Thanks
Leonardo Rodrigues  de Mello

Fixes as required on the pull request
Merge pull request #3235 from kylog/lmello-fix_pup-2289

(PUP-2289) Fix host type newline validation