Language-learning app Duolingo makes around $500 million annually, despite offering all of its lessons for free. WSJ explores how the company is using AI and A/B testing to keep users hooked.