Frontend: Menu input overhaul.

* Require Menu Select and Menu Cancel to be released before exiting most menus.
* Prioritise Menu Select and Menu Cancel over the rest so that a direction does not apply if one of those is held.

This is a giant hack. It reorganises lots of code and copy-pastes the fix multiple times.