Use XMLHttpRequest constructor in JS modules