Table manipulations and selection

From #634 .