[WIP] Struct packing

This introduces some convenient functions for packing struct arrays. It also brings in some changes to pointer_types to make this work more smoothly.