Generate unique IDs and free all instance variables on dealloc.