Law and Macro-Finance: The Legal Origins of Credit Booms and Busts