First basic working version of catalog import/export

This commit adds two new cli commands (`import` and `export`),
which can import and export catalog data (as .json files) to
and from PuppetDB.

It also moves the existing `catalog` endpoint (which was intended
to provide support for doing graph visualizations of a catalog) and
all corresponding code to new namespaces named `graphviz-catalog`.
This change makes room for a new `catalog` endpoint that simply
returns catalogs in our normal wire format, without the added
functionality for counts and aggregation that were needed for the
graphviz versions.

This commit is still not quite shippable; it is missing (at least)
the following:

* ability to configure host/port for import/export commands
* read/write data to/from tarballs rather than just a directory
  full of `.json` files
* add a metadata file which indicates which version of the
  `replace catalog` command should be used during imports
* add shell scripts to simplify the use of these tools from the
  command line.
Add support for export metadata during export/import

This commit adds code to the export command to cause it to generate
an `export-metadata.json` file.  At the time of this writing, the
contents of that file are simply a map containing the version number
of the `replace catalog` command that should be used during import.

The commit also adds code to the import command to cause it to expect
this metadata file, to parse it, and to use the version number that
it finds therein when submitting catalogs via the `replace catalog`
command.

Conflicts:

	src/com/puppetlabs/puppetdb/cli/import.clj
Add configuration options for host/port

Prior to this commit, the import/export tools had hard-coded
values of "localhost" and 8080 for the PuppetDB host/port.
This commit simply adds configuration options that allow you
to override the defaults.

Conflicts:

	src/com/puppetlabs/puppetdb/cli/export.clj
	src/com/puppetlabs/puppetdb/cli/import.clj
Modify import/export to read from / write to a tarball

Prior to this commit, the import/export tools were reading from
and writing to a bunch of files in a directory.  This commit
adds a new `archive` namespace, with utility functions for reading
from and writing to tarballs, and ports the import/export tools
over to use the functions therein.  This means we are now importing/
exporting directly to a tarball.

Conflicts:

	src/com/puppetlabs/puppetdb/cli/import.clj
Get rid of `:document_type` in catalog output

The example JSON catalogs that I was given all included a top-level
key called `document_type`, with a value of `"Catalog"`, so I included
that in my export output.  After discussing with Nick Lewis, it
sounds like that is an artifact of some Puppet PSON implementation
and is not desirable or necessary.  This commit removes it.
Add timestamp to export-metadata

Nick's export tool included a timestamp in the metadata, which
seems like a good idea.  This commit adds that to the clojure
export tool.
Add import/export shell scripts to packaging

This commit adds `puppetdb-import` and `puppetdb-export` shell
scripts to /usr/sbin.  It also fixes a minor bug in how we
were handling bash CLI args for the existing `puppetdb-foreground`
script.
Updates based on pull request feedback

* Renames `graphviz_catalog` namespaces to `planetarium_catalog`
* Several stylistic changes / better use of existing clojure library
  functions
* Get rid of extraneous input stream reference in tar/gz library
Add a lazy `all-entries` sequence to the tar archive library

Previously, if a caller wanted to loop over all of the available
entries in a tar archive, they'd have to do some fairly nasty
loop/recur stuff.  This commit adds an `all-entries` function,
which returns a lazy sequence of all of the entries in the archive.
This allows callers to write much more idiomatic clojure to iterate
over the entries in the archive.
Minor tweaks to test code based on pull request feedback
Fix bug preventing tests from running against HSQL

Because of an oddity in how our test-db fixture works, the tests
related to import/export would work properly against a Postgres
test database but would fail against an HSQL one.  This change
simply corrects how I was going about determining the database
connection info in my catalog test utils so that it works with
either database.
Filter out nodes that don't have a catalog during export

Prior to this commit, the export tool was trying to get
catalogs for all the nodes that were returned by the `/nodes`
endpoint.  It is possible that some of those nodes won't have
a catalog, and in those cases, the export tool was crashing.

This commit simply applies a filter to remove nodes whose
catalog timestamp is null, thus pruning them from the rest
of the export process.
Parallelize catalog retrieval during export
[packaging] (#19326) terminus files conflict

Prior to commit b2aa562, the terminus package simply owned
%{puppet_libdir}/puppet, which conflicted with the puppet package. That commit
changed the terminus package files to explicitly own every file, thereby
removing the conflict. However, as kbarber points out, the terminus package
files are still owned by (pe-)puppet, which is unnecessary and different than
the puppet package - the files should just be owned by root, both to align
ownership and to minimize any sort of attack surface if the puppet user is
compromised. This commit updates the packaging to change the ownership to root.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
Merge pull request #456 from MosesMendoza/maint/master/make_root_own_terminus_files

[packaging] (#19326) terminus files conflict
Docs: adjust formatting and flow of event and report endpoints
Merge pull request #458 from cprice-puppet/maint/master/cherry-pick-event-api-docs-fix

Docs: adjust formatting and flow of event and report endpoints
Merge pull request #444 from cprice-puppet/feature/master/import-and-export

Feature/master/import and export