Added some helper methods for saving to files.

The additional functionality includes a confirmation dialog to
prevent existing files from being overwritten.