[core] Run the game in phases that can be specified from outside the core.