A quick script to dynamically build menus with arbitrary depth.