Cleaned up files.c a bit, made it parse the pages dir