Added support for ESC to close each submenu. Also minor code cleanup.