New navbar implementation

I rewrote our navbar implementation, trying to make it more structured and simpler to work with. Even though the new code has more lines, for me, it feels better and probably will be easier to maintain. It should do a better job at separating logic and content. It uses some different approaches in comparison to the old one, but does not lack any features we got. The generated HTML should be identical.

Please don't get me wrong, I'm not saying the current implementation is badly written, this is meant as a suggestion.

So the question is, @tresf, how do you feel about this style? Is this code you'd be able to work with, maybe even better than with the old one – or is it the other way round?