The old JSON encoder with `encode_json` support (Removed from core in Rails 4.1)