Thread manager for running scheduled and asyncrhonous tasks.