Introjucer: minor refactoring.
Some minor clean-ups and comments in Thread class.
Introjucer: fix for a situation where project groups could get duplicate IDs.