An Essex County judge granted class certification on behalf of 3,700 former surgery center patients instructed to get tested for HIV and hepatitis after inspectors found unsanitary conditions there.