(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
(PDB-660) Event-counts streaming

This enables streaming for the event-counts endpoint.

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