moved `take` and `yield_chunks` into a more central utility module to make things easier for other tools to use it.