Wide-ranging marijuana legislation that targets some of the most persistent issues that activists, regulators, businesses and municipalities have said are holding Massachusetts back from realizing the full potential of the 2016 legalization law cleared the Senate unanimously Thursday afternoon.