From Catastrophe to Chaos: A General Theory of Economic Discontinuities