Add task deletion mechanism, including keeping finished tasks and
cancelling running tasks
Finish implementing task deletion mechanism