Cleanup spark_stream and add tests.