WiZard: a program to measure cosmic-ray antiprotons and positrons, and search for primordial antimatter