(change) Moved I/O functions to a separate header