Switch from history to backbone router.

Contains also changes from previous pr so would be good to merge that one first in order to review.