Implements `Encodable` and `Decodable`

Fixes #27
Merge pull request #29 from gifnksm/master

Implements `Encodable` and `Decodable`