Making sure to remove event listeners from window/document. Added check for document.readyState == 'complete' to call ready(). Changed buildUrl to accept a scheme as the first parameter. Cleaned up tests HTML.