Synthesis, Structure and Electrochemistry of Positive Electrode Materials for Rechargeable Magnesium and Lithium Ion Batteries: Mechanistic Investigations