Balancing the Osteogenic and Antibacterial Properties of Titanium by Codoping of Mg and Ag: An in Vitro and in Vivo Study.