Fix query api for custom primary key name.

@arthurnn & @camilo for review

Fixes #142

## Problem

Identity cache wasn't working when a primary key other than "id" is used.

## Solution

Use the primary_key method on the model's class to get the column name rather than hard coding `id`.