Added support for String type as StreamEventDecoder so that 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.