Use file path as working directory for Save As

I've changed the behavior so that if user runs save as action on the existing file, save dialog should point to the folder containing that file. If file is new, home folder is used as a base folder for the dialog. fixes #1044
make path parameter optional
Merge pull request #1096 from can3p/patch-2

Use file path as working directory for Save As