Added writing of test data to files