Adsorption and solution of H2 and N2 by Ta and Nb