Factored out IO classes into separate library.