added onDone and it passes most tests, but now rethinking the mechanism,
and considering an nextFn instead, for controlled streaming.

added many tests that actually test and not just demonstrate, to make
the lib more robust.
added production warning