Extracted AbstractScheduler; tests for Scheduler.