Tasks stop on unmanaged

stop tasks when entities are unmanaged, and better bookkeeping for scheduled tasks.
(also fixes eclipse IDE problems caused by checkstyle.)
I presume you changed this because it is crazily slow test? If we remove the calls to `System.gc(); System.gc();` then it's a lot faster. We shouldn't need to call that.