Replace StreamWriter with TextWriter in Response.BodyWriter

Replace occurrences of StreamWriter with its parent class TextWriter,
allowing greater testability by allowing use of other classes deriving
from TextWriter (i.e. StringWriter) for creating mock writers.