(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.
I guess because the finally block above got removed and all this fall under the try block now.