Implemented Encodable, Decodable

I went over the lib and derived Encodable and Decodable for all structs.