SingleThreadedScheduler added with test class.

Changes and fixes all through the scheduler.
Final tests to be thought of and added.