Change ExternalModuleEnumerator to use yield instead of sys.stdout.write

Add to ExternalModuleEnumerator two iterator methods that replace the
now-gone enum() method. This allows to re-use the class without invoking a
child process (hint hint Generator).