database integration

connected workflows to postgres database
rewritten several parts of chapter 2

fixes, moved some text to chapter 1 and chapter 3 according to meeting
feedback