Cleanup spark_stream and add tests.

This addresses the following things:

* Refactor `sparkStream` to a proper extension of `stream.Duplex` and make it a constructor.
* Add basic tests for `SparkStream`
* Listen to the `end` event instead of `close` on the spark. (`close` doesn't exist)
* emit errors from the spark on the `SparkStream`.