Removed unused vars
Protect XMLHttpRequest from garbage collection while active
Add Page Visibility API; close #239, #233