Add a `puppet storeconfigs export` command to dump the database

This command can be used to export a copy of the ActiveRecord
storeconfigs database (only exported resources, and only nodes with
exported resources) which can be imported into PuppetDB.  This is useful
when migrating from old-school storeconfigs to PuppetDB, as it allows
agents to run without losing any of their exported resources for a time.
Once every agent has run once, the database should be up-to-date in any
case.
Don't export catalog environment

This isn't actually a legal key on the catalog, so exclude it.
Write the storeconfigs database dump as a .tar.gz

Previously this was a single file containing many JSON objects, for the
catalogs. Now it's a .tar.gz (or .tar if gzip can't be found [or
directory if tar can't be found]) containing one file per node. The
tarball also includes a metadata file specifying the nodes which are
present, the timestamp of the export, and the version of the "replace
catalog" command which ought to be used to submit the catalogs to
PuppetDB.
Add a pending acceptance test for storeconfigs export

This test can't be finished until the import functionality for PuppetDB
proper is complete, but it seems better to have this start than nothing.
Add a product-name setting to the config file

This allows either puppetdb or pe-puppetdb, defaulting to the former.
This will let us know (basically) whether we're running on PE or not,
although it does use the honor system.
(#17839) Disable update checking when product is pe-puppetdb

This will allow us to prevent having individual components of PE
checking for updates at the same time as PE itself.
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.
Don't set product-name on OSS PuppetDB

This setting shouldn't really be tampered with, and "puppetdb" is
already the default. No need to tempt users.
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