Changed output handling in parser

Since the parser may have to go back and modify earlier entries, the
output could not be printed line by line, and is now stored in an array
of strings (can be modified to be a 2d array)