Add basic event handling

This allows the simulator to run on Windows without crashing whenever
it receives an event.