Factor menu.js out of editor.js