Separated file reading functionality into separate functions.

Started implementing the parse function.