Add wm data mining

Maybe this has to wait for #5150 to be taken care of and then reworked a bit? Or maybe not so that we can proceed with getting the database setup on cmsweb soon and the cron and DB writing in GatherStats would come later.