support infinite number of submenus
Merge pull request #25 from lociii/infinite_submenus

Refactor templates to support an infinite number of submenus