Removed the timeout mechanism and just use ios-sim's built-in timeout function. Also added a 'log-debug' event for printing debug output.