Adds generation of separate thread IDs per task
Replaces usage of global thread IDs with local thread IDs for all IPC