Switch to module-level encode/decode methods; remove encode! instance method.