A historic 45,000-square-foot commercial building in downtown Somerville has changed hands for nearly $2.7 million, according to a brokerage team with The Kislak Co. Inc.