Fixes xhr transport to emit message event asynchronously
Updates tests to use transport events instead of setTimeout