More work on the cron scheduler and lots of cleanup