Throw Errors in Exceptional Cases

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.

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.