Adding helper methods to wait on the document.readyState javascript variable
to verify the page loading is complete.