Effect of Gd Implantation on the Structural and Magnetic Properties of GaN and AlN