move XMLHttpRequest to worker, needs refactoring and more testing