A deal will permanently close a longtime animal testing facility and relocate nearly 500 remaining beagles.