Added router and history initialization