(CDAP-1088) Added support for String type as StreamEventDecoder

In MR and Spark it can consume stream body as String object.

Also reorganize the code in StreamInputFormat a bit to make code easier to read.
And also remove the need of Flow in the SparkKMeans test to speed up test.
^^ Same for this.