Move packing/unpacking shims to a module and describe issue