The Endogenous Market Structures Approach. A Technical Survey with Applications to the Theory of Business Cycles, Trade and Growth