Storage and cooling of ion beams