Refactory and decode/encode struct by gob interface

I modified ScanStruct function, when field of struct is a struct and has GobEncoder/GobDecoder interface to set field by encode/decode..