revamped and commented menu_init with more correct behavior, also implement optional on-cursor menu positioning