Factor out crossdomain into its own file