Convert to absolute file paths and localize cd()'s
Add option to pass model as string
Use OS-specific temporary directory as default working directory. Clean up after use.