(docs) Fix glitches noticed while backporting recent revisions to 1.6.x

* In 2.1 and up, the events endpoint is unsorted for v3 and v4.
* v3 doesn't support environments, but one line about them snuck in.
* Accidentally let "certname" (a v4-ism) slip into v3/nodes.
* Fix a busted URL and some glitchy header levels.
(docs) Port recent docs revisions to 1.6.x branch

This commit brings over the relevant changes from commit eb20757, since PuppetDB
1.6 will stay around a while for PE customers. I applied them by hand rather
than cherry-picking, to ensure no 2.1-isms would sneak over.
Merge pull request #1012 from nfagerlund/jul_2014_docs_16x

(docs) Port recent docs revisions to 1.6.x branch
Merge pull request #1013 from nfagerlund/jul_2014_docs_revisions_for_stable

(docs) Fix glitches noticed while backporting recent revisions to 1.6.x
(PDB-762) Fix broken export

This pull request fixes a malformed post-assertion in the events-for-report-hash
function that caused exports to fail on unchanged reports. Inserting proper
parentheses made it apparent that a seq, rather than a vector, should be the
expected return type.
Merge pull request #1015 from wkalt/ticket/stable/pdb-762-broken-export

(PDB-762) Fix broken export
(maint) Split out acceptance and unit test gems in a better way

We want to avoid installing all of the unit test gems when running acceptance.
This patch moves rake into its own place so we can use --without test properly.

Signed-off-by: Ken Barber <ken@bob.sh>
(maint) Switch confine for basic test during acc dependency installation

The way we were using confine was wrong, and since this is now more strict
in beaker it was throwing errors in the master smoke tests. This patch
just replaces it for a basic include? on the master platform instead.

Signed-off-by: Ken Barber <ken@bob.sh>
(cherry picked from commit 42f6ddfd1934b887984c381fc080fa883e83abc2)
(PDB-763) Provide trgm index handling for fact_paths

This patch adds a detection routine outside of the normal migration that will
nag the user if they don't have pg_trgm installed (or don't have a compatible
system for trgm and regexp performance, ie. pg 9.3 or above).

If trgm is working, it will manage installing the correct index on the
fact_paths table for regular expression query optimization.

Without a trgm index, globbing and regular expression queries will not use
an index and thus those queries become full table scans.

Signed-off-by: Ken Barber <ken@bob.sh>
Merge pull request #1033 from kbarber/ticket/master/pdb-763-trgm-indexing

(PDB-763) Provide trgm index handling for fact_paths
(PDB-772) Modify the facts endpoint to return structured facts

This pull request causes the v4 facts endpoint to return typed and structured
facts while leaving the v3 responses stringified as before.  It also adds a
"name" column to the fact_paths table representing the first element of a
fact's path.  This column should be renamed to "fact" in the future to avoid
confusion with the many references to 'certname' as name.
Merge pull request #1031 from wkalt/ticket/master/pdb-772-change-facts

(PDB-772) Modify the facts endpoint to return structured facts
(maint) maint/master/fix facts environment ordering

this fixes an issue with ordering by environment on the facts endpoint and
patches the corresponding blind spot in our tests.
Merge pull request #1035 from wkalt/maint/master/facts-environment-paging

(maint) fix order on environments for facts
(PDB-797) Add "name" field to fact-nodes response.

This adds a "name" field to the fact-nodes response.  The field "name"
represents the name of the parent fact of the fact node and is drawn from a
new column in the fact_paths table.
Merge pull request #1036 from wkalt/ticket/master/pdb-797-fact-nodes-name-field

(PDB-797) Add "name" field to fact-nodes response.
(PDB-798) Add capability to use regexp when querying fact-nodes path types

This adds the new operator ~> which is a path regexp operator that only works
against the `path` type. It works by internally converting the array of
regular expressions into a single regular expression for querying
fact paths.

Signed-off-by: Ken Barber <ken@bob.sh>
(maint) Fix old acceptance test refspec issue

The old refspec for acceptance testing source code only really worked for the
PR testing workflow. This patch makes it work for the command line or polling
based workflow as well.

Without it, it makes it hard to run beaker acceptance tests from the command
line.

Signed-off-by: Ken Barber <ken@bob.sh>
Merge pull request #1037 from kbarber/ticket/master/pdb-798-regexp-for-fact-node-paths

(PDB-798) Add capability to use regexp when querying fact-nodes path types
(PDB-816) Unstringify facts

This patch removes the fact stringification, now that we have all the backwards
compatible end point changes merged in.

Signed-off-by: Ken Barber <ken@bob.sh>