WIP: PDB-234 Add v4, deprecate v2 query API

This patch adds the new code relevant for doing any future v4 work. It has been
raised as an experimental end-point only so there are no commitments to its
interface yet. Once stable we will need another patch to declare it as so.

This patch also deprecates the v2 end-point in documentation and by adding the
same headers we used to use for the v1 end-point.

Signed-off-by: Ken Barber <ken@bob.sh>