Ferromagnetism and anomalous transport in GaAs doped by implantation of Mn and Mg ions