Update momenu.js

Little cleanup items. Converted some reused things into functions. FYI: haven't tested in the wild yet. Use at your own risk and report back w/ pull requests.