Test json (de)serialization.