Connected component subgraphs copy

Add option to copy (or not) subgraph data.
Rework connected components algorithms as generators.

Suggestion for #964