Allow ThreadGenerator param target to be iterable

Detech if the param 'target' is iterable, and use it without
calling it first.

Included also basic tests.

Change-Id: I02152fdbc8e32f4677fb839f18282350034a329e
Merge "Allow ThreadGenerator param target to be iterable"