Throw Explicit Errors when Collection is not defined

findPrimaryKey throws an Error when the primary key cannot be located but not when the
collection itself is not defined. Seems like a mismatch. Also causes dumb developers like
myself much grief when they accidentally have a typo in a name. A more explicit error
should help quite a bit.  Without it, the code just bombs out with a far more nebulous stack
trace.

Lastly, may want to consider consolidating these two findPrimaryKey functions into a single
place as they appear to be identical. Decided not to take a stab at DRYing this for the sake of
having a simpler pull request.