Read field names from data file

Also refactor parser to process lists of lines instead of InputStreams.