Moved save logic to new module.
Allow directory and file paths.