Essays in real estate finance : mortgage contract terms, pricing and behaviour