Essays on Firm Dynamics and Macroeconomics