Cleanup task_id globals

The following discussion from !107 (merged) should be addressed:

  • @rahix started a discussion:

    Note to self: This should go into modules/modules.h. Will fix this myself at some point.

Edited by rahix