Enable cancelling tasks

* Cancel tasks before they start executing
* Try to cancel tasks once they start executing (no guarantee an active thread will be killed, but you can start new threads for new tasks)
* Massive refactoring of TaskQueue on the server side for more direct control of mutation and related events.

Review by @havocp 

Also, I can rebase if you want me to unify this PR.