Refactor TD initialization
Description
The goal of this MR is to refactor td_init_run in such a way that it can easily be ported to the multisystem framework where the restarting is handled in a different way. Basically, it is just shuffling code around.
Checklist
-
I have checked that my code follows the Octopus coding standards -
I have added tests for all the new features added in this request.