Novartis agreed to pay $310 million upfront, with the possibility for more later, for some research assets of Boston-based inflammation specialist IFM Therapeutics as the Swiss drugmaker expands the company’s immunology pipeline.