Implementation of celery stats for active, pending and done tasks.

we should move this bit into celery_stats, so that it returns the list of tasks or task id's, instead of doing it here