Adding consistency to primary key discovery. Fixes #606.

This is mean't to fix issue #606 and possible others.

Right now if you set `primaryKey` to `false` on some attribute (which is common if you need to generate models dynamically), it's not properly checked and you end up with the wrong attribute being set as the model `primaryKey`.

I had to change this in 10 places, whereas I could have changed this only once. In the long run I believe we could have this on a function `findPrimaryKey()` in some common include file so we use the same function all over the place.