Studies of Spin Relaxation and Recombination at the HERMES Hydrogen/Deuterium Gas Target