Better tests for JSON serialisation