Bindings for primary_key option

Changing bindings on referenced relations to use a primary_key if given
[ #1850 ]
Adding specs for [ #1850 ]