Synthesis and Structural Studies of Calcium and Magnesium Phosphinate and Phosphonate Compounds