(PDB-456) Added environments endpoint and related query functions

Querying for all environments i.e. /v4/environments now supported along
with similar short hand queries for reports, events, resources and facts
like /v4/environments/PROD/facts/...
Added a ring middleware for creating a db transaction and a fixture for
diagnosing routes that don't create a connection
DRY'd up the environments docs a bit
Merge pull request #929 from senior/ticket/master/pdb-456-environment-endpoints

(PDB-456) Added environments endpoint and related query functions