abstracted filelist into a javascript prototype for reuse on a list of files in a directory