Replaced JFileChooser with FileDialog

also made several refactoring changes for how save and close work