added pack/unpack for hard type. and for type, but it runs out of mem. and cleaned up a bit
added pack/unpack for hard type. and for type, but it runs out of mem. and cleaned up a bit

ekmett/ermine,PipocaQuemada/ermine