Add support for multilevel dropdown menus

Due to multilevel menus has been dropped in Bootstrap 3, some code
changes are neccessary to get this function back. Imho this feature is needed because a lot of pages use menus that are deeper than 2 levels.