Moved scheduler to simpler single thread model.