Add extension traitlet to force dotted names

This addresses the problem from #7179 more generally. Tests will fail for this until that is merged.

I wasn't sure if this was really the best place for the custom trait, or if I should put it in `IPython.nbconvert.utils` or something instead.
Thinking about this some more, should we have an assertion before this that the value is of `py3compat.unicode_type`? So that there's a clear error message if you try to pass something else in.

Sorry, I keep thinking of more changes one at a time rather than in one go.