Hydrogen purification with metal hydrides in a new kind of reactor