Make the JSON encoder pluggable