Remove nil fields from JSON output

This makes it easier for clients (at least those using the Ruby wrapper) to check for field presence.