Moved response write to stream into CommandResponse class.