Exact Distributions for Rank Tests