Implements `Encodable` and `Decodable`

Fixes #27