Move some code to generate a simulation from a scenario to open-core. Other small improvements