Nationstar Mortgage — currently doing business as Mr. Cooper — has agreed to settle a lawsuit which alleges that the company violated mortgage servicing laws and forced borrowers into foreclosure.