fixed issue with being able to modify criteria in beforeFind and beforeFindAll hooks
added tests for find by primary key plugin
refactored and added tests