Moved I/O to its own module to prep for file support.