Refactor into single multitask, use kill-all and kill when parent dies

This is a very big commit... I know :-S

It addresses a few issues in one go. Initially I hacked away for my own use, but seems to fix problems others could also benefit from.

This should fix #1