Average goodness output to file on top level, memory issues fixed.

Average goodness of each experiment is output to a file in the top level directory of the given experiment set.
Fixed memory issues in the file_util class caused by file descriptors not being correctly released.