Partially refactored file IO methods. closes #21