Refactor the code

- [ ] Split big files to classes
- [ ] Get configuration out of the code
- [ ] Create DB handling class
- [ ] Create Task class
- [ ] Write tests
- [ ] Fix errors
- [ ] Create Composer package