Reasonable JSON serialization for custom classes