Support custom primary key on associations

Closes #61.