Added the for_each API's for vector.
Modified the first() and last() API in segmented_vector_iterator to properly get the indexes