Added unit test to demonstrate failure of history when navigating very quickly after first router initialisation.
(cherry picked from commit 8e78159)
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
(cherry picked from commit 2d8383b)