Added the OutputWriter class, which handles writing the output.