Changed the write function so that it accepts a filepath instead of a file object. Writing itself will be done in the file of the format rather than in graphcontext.py. This will allow future format 'plugins' to have custom export dialogs without having to rely on ExportOptionsDialog. This is so if a user cancels an export, a file is not written over.