Moderna Inc. is slashing four drug programs as it marches forward with vaccines against infectious diseases and cancer.