The jQuery for hiding and showing works now, but I'm going to fix it how it appends and shows an empty submenu if the submenu options array is empty, and I still need to re-write the data object merge.
Changed trial creation so the default value now works for submenus in case they are not defined individually. Also fixed the submenu creation so that it doesn't create empty selects if submenu array is empty.