Tasks stop on unmanaged

stop tasks when entities are unmanaged, and better bookkeeping for scheduled tasks.
(also fixes eclipse IDE problems caused by checkstyle.)
Worth a comment to say why deferring the deletion of its tasks. e.g. something like `don't delete record of its tasks yet; these will be needed to cancel the tasks`.

Was about to ask what deletes the entry from `unmanagedEntitiesNeedingGc`, but see you've added that in a later commit :-)