Adjusted utilities for tasks

Added specifically task based utilities TaskID (counterpart to
ThreadID), FlagsForTask (counterpart to Flags), and TaskLocal
(counterpart to TLocal).