Refactor complex methods checkin and checkout (#666)

As per #666. **This pull request is not to be merged yet, as it is lacking test coverage.** Review solicited, since the operations on the methods' internal logic are over.
No need for an extra DB call here, just set r.equipment_object_id to hash[:equipment_object_id]