(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
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