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.
The logic here is a little confusing, no chance of refactoring it more?
```
return if user.tos accepted
user.tos_accepted = !params[:tos_accepted].nil?
user.save
flash unless user.tos_accepted
return user.tos_accepted
111