JSON encoder refactor

# Goals

- [x] Replace `ActiveSupport`'s pure-Ruby JSON encoder with one based on the `json` gem
- [x] Maintain backwards compatibility (`encode_json` support) by moving the old encoder into a [gem](https://github.com/vanruby/activesupport-json_encoder)
- [x] NOT introduce significant performance degradation
- [x] Fix Rail's [`json` gem incompatibilities](https://github.com/intridea/multi_json/pull/138#issuecomment-24468223) (via #12862)
- [x] Fix `as_json` [not being applied recursively](https://github.com/chancancode/rails/tree/failing_tests)
 
### Nice to have

- [x] Pluggable backend? (so that the `encode_json` gem can take advantage of that)
- [x] Improved JSON performance (Benchmark: [full stack](https://gist.github.com/chancancode/f6b4e214bb49bf65b742), [raw JSON](https://gist.github.com/chancancode/44e42601e913cb851c73))
- [x] A technical explanation/spec for the all the relevant design ([here](https://gist.github.com/chancancode/ff3093b101d934065d1f))
- [ ] A user guide article explaining all these JSON related stuff

### Misc TODOs
- [ ] Ask: can we fix the json version to [>= 1.7.7](https://github.com/flori/json/blob/master/CHANGES#L11-L19)?
- [ ] Figure out what to do with [this](https://github.com/rails/rails/commit/72f37bd8bc5b3beb1e8a2d1ac2de2c045cd0cfd2) ([bug](https://rails.lighthouseapp.com/projects/8994/tickets/5655)), and people who overrides `to_json` in gerenral
- [ ] Check JSON ext compat: potentially mperham/sidekiq#1070
- [ ] Check JSON pure compat: [bugs](https://gist.github.com/chancancode/579f4f8520f7301d85a3), track flori/json#183
- [ ] Check JRuby compat
- [ ] Check RBX compat
- [ ] Check multi json compat...?
- [ ] Perf test: JSON API in discourse
- [ ] Perf test: compiling assets
- [ ] http://hashrocket.com/blog/posts/faster-json-generation-with-postgresql / https://github.com/JackC/json_api_bench
- [ ] Close #9212 
- [ ] Check #12723