Refactor task invoking code to gaggle-core. Run various tasks on the correct threadgroup and appcontext.