Redo encoding/decoding logic with scalaz scodec