The Microfoundations of Housing Market Dynamics