Added the first piece in outputting an in memory edi document back to the original format. Also fixed a bug with parsing new line segment terminators.