Add save-as-file and save-as-file-and-open, also handles scratch buffer. Fixes #17