Fix get_objects_for_user to work with objects with non-integer primary keys

fixes #204
fixes #217
fixes #252

Includes 3 tests that touch the previously problematic areas in the code.