Effect of Magnesium Substitution on Structural Features and Properties of Hydroxyapatite