Allow setting default chunksize in generator function, remove extra closures