Added safe filepath function and arguement parser to allow for testing paths and filenames from command line.