refactor code to use models
add config vars for notification mails and triggerinterval
add softdelete for tasks