Fixed bug with events in the global object
And removed sendcmd event since it's barely used in the instasynch source.