Switch to use XHR for request

Using XHR for requests means we can auth properly and will no longer
need to fake a login page.

I also tidied up the interval logic so that it doesn't carry on trying
to load pages untill the last one loaded. Will need to monitor how that
works though as if the page request times out it should try again.