Added option to write simulated tree to file.