Revert "Revert "Rewrite code updating navigation.rb""

This reverts commit 8866b64e6b40fe917c5ac98b48415f96020f6461.
Merge pull request #1864 from vuntz/rebuild-navigation

https://github.com/crowbar/crowbar/pull/1864

Merged by devtool for cloudsleuth