Exciton binding energies and diamagnetic shifts in semiconductor quantum wires and quantum dots