A powerful midsummer storm walloped much of Massachusetts Tuesday, including a tornado that tore down trees and power lines in Mattapoisett; forced crews to rescue stranded motorists from flooded roadways in places like Lawrence and Natick; and dumped several inches of rain across the region.