Alloying of electrode materials