Types and deadlock freedom in a calculus of services, sessions and pipelines