input_segment renamed to range_input_segment, generator_input_segment and tests added, from(generator_fn) is now supported