Add doctest to num_utils.
Make chunks work with iterators.