Fixed #8 by recapturing window instance after location changes
Fixed #9 by using periodic "ready" state vs "unload" (same logic that IE
uses)