Fixes: #2408 Rework menu html code
Lots of cleanup about code style and unused or duplicated code