Factoring compact and weakly compact operators through reflexive Banach lattices