Decomplexified/simplified/fixed menu stuff. Memutils added for possibly
simpler unique_ptr usage.