separate_trajectories function

Separate rows of data into separately labeled trajectories.