Psi-CAL: Foundations of a Programming Language for Services Computing