Updates the scheduler and the scheduled tasks to use a background task runner (ported from new courier codebase with tests) so that they are web aware and wind down properly.