The housing market has witnessed a surprising and sharp turnabout over the past year, first as investors have soaked up an oversupply of foreclosed properties and later as rising rents, low mortgage rates, and improving consumer confidence have unleashed pent-up demand for housing.