MBE growth and characterization of magnesium-doped gallium nitride