Experimental techniques for cold chemistry and molecular spectroscopy in an ion trap