window.onpopstate is null error in fire()

Better handling of cases where there's a race condition on start, setRoute called before onpopstate is set. When fire is triggered (e.g. through setRoute) an error occurs if we haven't set onpopstate. Thus, make sure to record any fire calls, set onpopstate as soon as DOM is ready (+1 event loop), and then resume, possibly triggering a recorded fire call.