Small fixes
Implement calculating duration at cursor position in text
Store database in file

* save, update and delete data from database in separate thread