Exact Null Distribution with Ties

I am interested in deriving exact null distributions for small-sample test statistics with non-trivial ties. Not fundamentally continuous variables that happen to have a few repeated values, but ordinal variables like grades (F to A) or Likert (very unhappy to very happy) where ties are fundamental to the problem.

I am aware of the practical prescriptions for dealing with ties: use half-ranks, use the tau-b formula, etc. What I am looking for is an theoretical treatment which derives an exact null distribution from the underlying null hypothesis.

Let me take Kedall's tau with n = 2 as an example. Without ties, there are 4 possible patterns of concordance: CC, CD, DC, and DD. CC gives K = 2, CD and DC give K = 1, and DD gives K = 0. Under the null hypothesis each pattern is equally likely, so the exact distribution of K is 1/4, 1/2, 1/4 on [0, 1, 2].

Now what about with ties? The patterns are now the four above plus TT, TC, TD, CT, DT, but the T and not-T values are not equally likely; instead the T-values will occur at some rate related to the underlying probabilities of the ordinal values. Can I get around this problem by computing some K' that treats T and not-T differently?

The poking around I have done so far hasn't yielded any papers of textbooks that deal with this. I would love to see a treatment for Kendall's tau or any other common statistic on ordinal data.