Adds getPathAndFilename function to split absolute filepaths into path segments and filenames.