json: reorder delegates
encoder: stop using defp/4
encoder: stop using to_binary
decoder: add some specs
encoder: add some specs