On the Testable Implications of Causal Models with Hidden Variables