Add file auditing to the main code base

Create a macro and simplify the file auditing process.