Causes and Explanations: A Structural-Model Approach, Part I: Causes