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.
You could probably make a single method that handles all procedures and notes in a single go, though I understand if you want it abstracted into two different methods