Refactor JS for menu

Allow easier changes in the reference to HTML classes.