Rebase of PR 2482: Issue 6989 - create a better string representation of Tid

This is a resubmission of https://github.com/D-Programming-Language/phobos/pull/2482 because the original author went MIA. The code has been squashed and rebased so that it merges with master properly.