Credit markets, intermediation and the macroeconomy