Support templates in the menu

To be able to show directives in the menu.

BREAKING CHANGE: Menu loader methods should now return an array of
elements or promises, not either an array or a promise as earlier.