serialize events over the bridge
remove some references to window in the event system