Collapse stores a list of original ids

Fixes #503

Instead of storing the original metadata, it creates a new category called `collapsed_ids` and stores a list of original ids.