Refactor - Move file function to files.py

This function that checks for the rewrite base is primarily doing some file level stuff, so I'm moving it over into the files.py module
Refactoring - Moving another file operation to file module