Fixed pack and unpack to use prep/unprep on fields, added test