Add exclude_nils option to as_json.

`as_json` now accepts a `exclude_nils` option to 
skip nil attributes in the resulting JSON output.
This option peacefully coexists with the `except`
and `include` options.