Superlattice modulation and superconductivity in the electron-doped Nd2CuO4−xFx and Nd2−xCexCuO4 systems