Remove manual encodable implementation. Fixes #3425.