The members of the union representing journalists and business-side employees at the Boston Globe have ratified a new contract after nearly three years of contentious negotiations.