Platform agnostic XMLHttpRequest implementation