Essays On Macroeconomics With Microeconomic Heterogeneity