A new general synthesis of functionally substituted pyrazolo[1,5-a]pyrimidines