new Router and History manager

fxxking big commit