Refactor packing of generic hash events (gc_stats)