more refactoring of the taskmgr javascript