event_lib: move last IDs stuff to LastIdsWrapper class