Check for firstPush should be more robust

state.dynatable can't be relied on since it will exist when navigating back to a page containing dynatable.
However, replaceState must be used in this case otherwise there will be two history entries for the same page and forward history will be overwritten.