Constrain selectors to pivot table context

Fixes issue #34
compiling changes from pull request #35