Move stateful code over to rarch_main_set_state (for menu toggling)