Redesigned pack_data() to handle sequence generation.
Authored by: bugman 2009-10-09
Parent: [r9684]
Child: [r9686]