Major rework to TimeScheduler - increased threadsafety and elegance