Added more checks for replaceState for IE9. Changed location API to use a relative URL for browser compatibility.