Added in_line_seg function and tests.