Fixed clenfile_X() functions and file_write().

clean_file_map and clean_file_comp were renamed and changed to reinsert newlines at the ends of lines after removing the whitespace. file_write was chagned to remove repeated code and to not force a file extension on the user.