Essays on dynamic international trade and macroeconomics