Moved the scheduler/simulator into a proper lib class