The causal hierarchy of spacetimes