dct: merge T_*() and Tt_*() functions

This will simplify the non recursive form.
dct: allow passing scalars to diag()