Added a function to write a simulation to file
Ignore tree outputs
dump now terminates correctly
Added a flag to run in dump mode