value_iterator for list_intervals + test case

Based on an original implementation of Serge Guelton.