First-principles calculation of pKa values for organic acids in nonaqueous solution.