Move code for runtime into own file.
Oops, don't terminate immediately