(PDB-658) Move environments endpoint to the query engine

Needed to add support for an empty query to the engine. This was needed
to query for ALL environments.
Merge pull request #984 from senior/pdb-658-moving-env-to-qe

(PDB-658) Move environments endpoint to the query engine