Modeling Mortgage Prepayments and Valuing Mortgages