Adjust setSelection to use primaryKey.

Provides a fix for #580, which is a bug in toggling selections while
paging through data.

Before this patch, getSelection had support for using
grid.config.primaryKey. The setSelection operation on the other hand did
not, which caused this subtle bug.

This commit introduces a getSelectionIndex method that pulls the logic
for using grid.config.primaryKey out of getSelection and adjusts
setSelection to use getSelectionIndex.
Merge pull request #641 from rubenv/setselection-fix

Adjust setSelection to use primaryKey.