AS JSON encoder: remove monkey patch of Array

This patch moves a code from `Array#to_json` to `Enumerable#to_json`
Monkey patch of Enumerable is enough.
Old implementation of `Enumerable#to_json` was `to_a.to_json` that spawns unnecessary array sometimes.

The diff is a little confusing and don't show that is going on.