Moved menu code to separate menu.js file