Db refactor cleanup

Remove the first database implementation and fix up collection stats appropriately.