added Typed Flatten and FlattenTo
Merge pull request #410 from twitter/feature/more-flatten

added Typed Flatten and FlattenTo
Add distinct method to RichPipe and TypedPipe, as well as corresponding tests.
Change implementation of distinct to a more type-clear way.Add docstring
Merge pull request #413 from reconditesea/klin_add_distinct

Add distinct method to RichPipe and TypedPipe