Added __init__ method for MStruct
Added encode_packet
Added EncodeError exception