Magnesium ion based organic secondary batteries