added Typed Flatten and FlattenTo

addresses: #408 #407