Backport setting time_precision for JSON::Encoding

`iso8601` can take decimal precision as an argument, this commits backports 2 commits from `4-1-stable` (4cfc467 && c096500) which add ability to set default precision for AS encoder.

/cc @square/railsfork-contributors