Eliminate `JSON.{parse,load,generate,dump}` and `def to_json`

JSON.{dump,generate} offered by the JSON gem is not compatiable with
Rails at the moment and can cause a lot of subtle bugs when passed
certain data structures. This changed all direct usage of the JSON gem
in internal Rails code to always go through AS::JSON.{decode,encode}.

We also shouldn't be implementing `to_json` most of the time, and
these occurances are replaced with an equivilent `as_json`
implementation to avoid problems down the road.

See [1] for all the juicy details.

[1]: intridea/multi_json#138 (comment)
Merge pull request #12783 from chancancode/eliminate_direct_json_gem_use

Eliminate `JSON.{parse,load,generate,dump}` and `def to_json`