Some of the biggest tech companies and startups based in Massachusetts ranked as having the "happiest" workforce in the country, according to new data.