add option to hide empty menu items

Add a configuration option to hide menu items that have no visible children.