Added reverse segment variables

New segment variables allow indexing segments in reverse order:

{rev_segment_1} = {last_segment}
{rev_segment_2} = second to last segment
etc.

Uses the value $last_segment_id, which does not include any trailing /P## segment, as the "first" reverse segment.