More work on the check_files script

Very much a work in progress, but I'm out of time for the day.

#59