Added a Scheduler to schedule events for some time in the future and also to execute stuff on the main thread from within a different thread