Tasks stop on unmanaged

stop tasks when entities are unmanaged, and better bookkeeping for scheduled tasks.
(also fixes eclipse IDE problems caused by checkstyle.)
probably worth doing this in `finally` block. Otherwise a failure in this class' tearDown could break subsequent tests in jenkins in strange ways.