Adjust `log_profile` / `plot_profile` and `test_profiling` so in testing we write to `tmp_test_data_dir` Closes #331 See merge request !469