PDB-437 Reduce API source code and version inconsistencies

The API code when split between different versions created an opportunity for
inconsistencies to grow. For example, some versioning inside the code supported
this file based way of abstracting versions, but other functions required
version specific handling.

The problem was that the version wasn't always filtered down properly due to a
lack of a structured way of handling versions.

Not only that, whenever a new version of the API is cut the amount of code that
is simply copied and pasted was quite large.

This patch collapses any version specific code into a single unit. For example
the end-points v2/facts and v3/facts can now be handled by the same application.

The way this is achieved is by passing a keyword of the version: :v1, :v2, :v3
from the top level ring app and pass that into any functions that require
'versioned' capabilities. This version can then be used in decision code (ie.
like a case statement) to execute differently dependant on version.

Because the version pattern is consistent, we should be able to ensure that
particular versioned behaviour is also called consistently no matter where in
the stack a function is executed. This should reduce cases like we've seen
before where v3 api end-points still exhibit v2 behavours on very specific
experessions.

For the query parts of the code, we've applied the same versioned pattern.
The tests now iterate across all supported versions for each tests as well
providing more coverage generally.

Signed-off-by: Ken Barber <ken@bob.sh>
PDB-437 Clojure lint cleanups

Remove some circular dependencies from copy & pasting and remove more cases
of unlimited 'use'.

Signed-off-by: Ken Barber <ken@bob.sh>
PDB-234 Cleanup some minor code duplication and missing versions from case

Signed-off-by: Ken Barber <ken@bob.sh>
Merge pull request #843 from kbarber/ticket/1.6.x/PDB-437-reduce-http-code

PDB-437 Reduce API source code and version inconsistencies
Merge branch '1.6.x' into maint/master/api-cleanup-rollup-from-16x

This commit includes some hand modified changes to remove more :v1 deprecations
since this that original patch was merged. Downstream changes in 1.6.x had
basically added more :v1 knowledge, but the manual changes as a part of this
merge have removed those references and will now throw exceptions for any :v1
version reference.

* 1.6.x:
  PDB-234 Cleanup some minor code duplication and missing versions from case
  PDB-437 Clojure lint cleanups
  PDB-437 Reduce API source code and version inconsistencies

Conflicts:
	src/com/puppetlabs/puppetdb/http/v1/node.clj
	src/com/puppetlabs/puppetdb/http/v1/resources.clj
	src/com/puppetlabs/puppetdb/http/v1/status.clj
	src/com/puppetlabs/puppetdb/http/v2.clj
	src/com/puppetlabs/puppetdb/query.clj
	src/com/puppetlabs/puppetdb/query/facts.clj
	src/com/puppetlabs/puppetdb/query/nodes.clj
	src/com/puppetlabs/puppetdb/query/resources.clj
	test/com/puppetlabs/puppetdb/test/query/resources.clj
Merge pull request #846 from kbarber/maint/master/api-cleanup-rollup-from-16x

Maint/master/api cleanup rollup from 16x