Added a separate io file to handle reads / writes and make the main script into a class