Foundational Aspects of Contract Compliance and Choreography Conformance