Add business logic for loaning

- Fix and issue with database transactions
Add logic for lending books
Add GUI for lending books