solve issue #3

Duplicated codes in StreamSink, StreamSource, StreamTask has been
encapsulated into StreamComponentFactory. Test passed. Commented codes
may be removed if no further modification is needed.