Add tests for generators.
Various fixes.

Check for args when assigning names. Listen for finish event when calling done().