(PUP-3512) Use new Profiler API

Change the `profile` function in PuppetDB to use the new Puppet
Profiler API in preparation for removing the old API from Puppet.
Modify all calls to the `profile` function in PuppetDB to pass in
a metric ID.
Merge pull request #1157 from fpringvaldsen/PUP-3512-new-profiler-api

(PUP-3512) Use new Profiler API
(PDB-1029) Provide an arity detection for backwards compatibility for profiling

This patch fixes the arity problem on the oldest version of Puppet we support
by adding a compatibility layer that uses the correct argument list based
on the methods arity available.

Signed-off-by: Ken Barber <ken@bob.sh>
(PDB-1017) Fix node tests hiding failures

There were several tests that were failing in v4 that were being hidden
by skipping over the assertions when the resulset was nil/empty. This
commit adds an explicit result count check and fixes the tests that were broken.
Merge pull request #1161 from senior/ticket/master/pdb-1017-node-tests-broken

(PDB-1017) Fix node tests hiding failures
Merge pull request #1160 from kbarber/ticket/stable/pdb-1029-fix-profile-compat

(PDB-1029) Provide an arity detection for backwards compatibility for profiling
PuppetDB: broken links in connect_puppet_master

Fixed /api/query/v3/events.html
and /api/query/v3/events.html
(docs) Using an extract is now possible at the top-level

So we now allow an extract at the top level, this patches the documentation to remove the
strict statement about this not being allowed. The docs for the subquery elements still make
sense.
Merge branch 'stable'

* stable:
  PuppetDB: broken links in connect_puppet_master
  (PDB-1017) Fix node tests hiding failures
  (PDB-1029) Provide an arity detection for backwards compatibility for profiling
  (PUP-3512) Use new Profiler API

Conflicts:
	puppet/lib/puppet/indirector/facts/puppetdb.rb
	puppet/lib/puppet/indirector/resource/puppetdb.rb
	puppet/lib/puppet/util/puppetdb/command.rb
	src/puppetlabs/puppetdb/query_eng/engine.clj
	test/puppetlabs/puppetdb/http/nodes_test.clj
(maint) Repair tests from last merge-up

I missed a couple of failing tests last merge-up, this fixes that issue.

Signed-off-by: Ken Barber <ken@bob.sh>
(PDB-1028) Make /v4/catalogs queryable

This expands the /v4/catalogs endpoint to have full query and paging capacity,
and brings the catalogs endpoint into the query engine like the others, which
will be useful for syncing and future consistency.
performance issue resolved
gut most v2/v3 functions from query/catalogs