Support encoding.TextMarshaler/Unmarshaler.

Fixes #38.