Move ParserTools to separate file. Add TextWriter.