Before you get a new mortgage or refinance an existing one, remember these things.