Improve pipeline middle results by using queue.

This will make pipeline work somewhat like Python generator and reduce
memory usage.
Improve Pipeline's constructor.
Set special rule for combining std::vector<T>.