Essays In Mortgage Funding And Risk Management