Add an identifier to TypeParameterDefs and use it to pretty print type parameters

Fixes #2951