Changed the way ID are collected. All referenced IDs are collected and mapped to uniqued IDs. Unreferenced IDs are removed in order to save space.