Refactoring of navigation (mainly the secondary one)

Sorry for the big commit, but as it is more a rewrite as refactoring…
Some minor issues still in there…