Electrolytes for rechargeable magnesium batteries