(PDB-826) Fix pathing for puppetdb-legacy

For PE the puppetdb-legacy scripts (such as puppetdb-ssl-setup) expect the
puppetdb script to be in the path. This assumption isn't always true, as we
install PE in a weird place.

This patch adjusts the PATH for this single exec so that it also includes
the path of the directory where the original script is found, which is usually
/opt/puppet/sbin.(PDB-826) Fix pathing for puppetdb-legacy

Signed-off-by: Ken Barber <ken@bob.sh>
Merge pull request #1045 from kbarber/ticket/master/pdb-826-pe-paths-for-puppetdb-legacy

(PDB-826) Fix pathing for puppetdb-legacy
(PDB-809) Store top level structured fact data as JSON

This adds the storage of the top level facts that happen to be structured in a
new column of fact_values called `value_json`. This is provided so we can query
top level facts for the /facts endpoint in a performant way, without having
to also reassemble the pieces of values into a JSON object later on.

This patch also removes some dead code from the facts endpoint code, and moves
the generalised reassembly code that was shared between facts and factsets into
a factsets specific area. Since now, this is the only endpoint that needs this
code.

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