Implemented event queue priority and simulation loop in main Tmcs.