Introduce TypeDecoder

This complements TypeEncoder for modifying how scalang marshalls
primitive types.