Hook up to DB. Return number of incidents and reports.

Copied across some stuff from incident-worker re. db and counts.
Renaming.