fix misc js issues with sorting and nesting menu items