added codec for market historical snapshot

the codec is really not used at the moment. The old version of codec is still used to convert from Bar to MarketHistoricalSnapshot due to too much dependency on Bar interface at the moment.