All states are now handled by the new menu system, although some are flagged to have a custom handler that does everything by itself.
I replaced most reference parameters to pointers to be able to typecast in a nicer way.
Key input is not passed as a parameter to the menu functions instead of having global variables they all access. I think I broke one thing by doing this, since there is no way to propagate key input changes to the next frame.