internal term decoder/encoder replacement

Use external io-based term decoder/encoder.