ENH: Much cleaner file handling