Major stock indexes gained Monday as the market looks to build on a surprisingly strong week, though several notable companies, including Tesla and several New York-listed Chinese firms mounted large losses.