Improving the durability of ion insertion materials in a liquid electrolyte