(PDB-526) Garbage collect unreferenced environments

This patch adds a new step for garbage-collect! which removes any environments
that are no longer referenced by reports, facts or catalogs.

It also changes the order that garbage-collect! runs compared to the other
db related cleanup tasks. This is so that unreferenced environments are
cleaned up immediately after nodes and reports are purged, as apposed to
having to wait for the next scheduled internal.

Signed-off-by: Ken Barber <ken@bob.sh>
Merge pull request #919 from kbarber/ticket/master/pdb-526-cleanup-old-envs

(PDB-526) Garbage collect unreferenced environments