Fundamental and practical aspects of alloying encapsulated gold-based contacts to GaAs