Currently we are relying on the GC to close any files that we have opened. Need to change this so that the file handles are explicitly closed.