Created a new function, save_data(), which handles errors that arise when saving a file (e.g. trying to save to an invalid location). It saves the data in a temporary file then asks for a new filename to use. If this also fails, it hands control over to the user (in debug mode).

This function also saves extra data about the environment in which the data was created, including the source of 'get_simulation_value' and the source of the originating file. If requested, add_extended_info_to_file() can be used to add the source of even more files after calling save_data().

save_data() was designed to have the same signature as save() so that a simple find-and-replace would complete the transition. No significant data has been generated yet using this new scheme but the hope is that it will eventually be universally used.