A JSON encoder that supports Object#encode_json (removed from core in Rails 4.1)