simplify OpenStruct/OpenObject json serialization
simplify OpenStruct/OpenObject json serialization

refs CNVS-7597

I could not find any instances of as_json being called directly (i.e.
not by to_json or the recursion in as_json). I could not find any
existing instances of nested OpenObjects (i.e. to trigger the recursion
in as_json). And it appears to me that we'd want the same object_type
"scoping" that to_json was doing even in a nested OpenObject#as_json. So
I move the object_type scoping from to_json to as_json; at this point,
to_json matched Object#to_json, and could be removed.

I introduce OpenStruct#as_json for consistency and to get rid of the
bare calls to OpenStruct#table in OpenObject#as_json.

With the recent change to Time#as_json, that branch in as_json can also
be simplified to value.as_json.

But the as_json calls on the subobjects are unnecessary; when the result
of the top-level as_json is json-encoded (through to_json), each element
will go through the appropriate ->as_json->to_json transformations as
well. So the .as_json calls can be dropped, and as_json (modulo the
object_type scoping) just becomes a call to table -- which is the
superclass' as_json. Handy!

test-plan: N/A

Change-Id: I783f1d3fbdcc6d71518c5f0f2d60a1faecc0c2fb
Reviewed-on: https://gerrit.instructure.com/23646
Tested-by: Jenkins <d95b56ce41a2e1ac4cecdd398defd7414407cc08@instructure.com>
Reviewed-by: Jacob Fugal <f862f167b85d41b225785c70d70808bc7337c1fe@instructure.com>
Product-Review: Jacob Fugal <f862f167b85d41b225785c70d70808bc7337c1fe@instructure.com>
QA-Review: Jacob Fugal <f862f167b85d41b225785c70d70808bc7337c1fe@instructure.com>

eCNAP/CANVAS,grahamb/canvas-lms,sdeleon28/canvas-lms,SwinburneOnline/canvas-lms,skmezanul/canvas-lms,skmezanul/canvas-lms,gbleydon/canvas-lms,efrj/canvas-lms,HotChalk/canvas-lms,arrivu/arrivu-lms,SwinburneOnline/canvas-lms,eCNAP/CANVAS,whalejasmine/canvas-lms,usmschuck/canvas,arrivu/jigsaw-lms,sfu/canvas-lms,narigone/canvas,Jyaasa/canvas-lms,eCNAP/CANVAS,sfu/canvas-lms,kyroskoh/canvas-lms,wrdsb/canvas-lms,fronteerio/canvas-lms,venturehive/canvas-lms,HotChalk/canvas-lms,roxolan/canvas-lms,arrivu/qibla-ecampus,instructure/canvas-lms,snehakachroo1/LSI_replica,kyroskoh/canvas-lms,utkarshx/canvas-lms,juoni/canvas-lms,Jyaasa/canvas-lms,wimemx/Canvas,HotChalk/canvas-lms,redconfetti/canvas-lms,landonwilkins/canvas-lms,arrivu/hoodemo,ShreniiNepal/shrenii_lmp,greyhwndz/canvas-lms,sfu/canvas-lms,va7map/canvas-lms,narigone/canvas,redconfetti/canvas-lms,Rvor/canvas-lms,jay3126/canvas-lms,wimemx/Canvas,jay3126/canvas-lms,antoniuslin/canvas-lms,snehakachroo1/LSI_replica,leftplusrightllc/canvas-lms,shidao-fm/canvas-lms,efrj/canvas-lms,venturehive/canvas-lms,wrdsb/canvas-lms,Rvor/canvas-lms,venturehive/canvas-lms,Rvor/canvas-lms,wrdsb/canvas-lms,AndranikMarkosyan/lms,arrivu/jigsaw-lms,loganrun/pincan,redconfetti/canvas-lms,kyroskoh/canvas-lms,tgroshon/canvas-lms,AndranikMarkosyan/lms,arrivu/hoodemo,arrivu/qibla-ecampus,shidao-fm/canvas-lms,tgroshon/canvas-lms,landonwilkins/canvas-lms,wrdsb/canvas-lms,efrj/canvas-lms,grahamb/canvas-lms,sfu/canvas-lms,wye0220/shindig-canvas,usmschuck/canvas,arrivu/qibla-ecampus,antoniuslin/canvas-lms,matematikk-mooc/canvas-lms,ShreniiNepal/shrenii_lmp,greyhwndz/canvas-lms,fronteerio/canvas-lms,utkarshx/canvas-lms,instructure/canvas-lms,leftplusrightllc/canvas-lms,tgroshon/canvas-lms,samuels410/greatlakes-lms,greyhwndz/canvas-lms,antoniuslin/canvas-lms,sfu/canvas-lms,ShreniiNepal/shrenii_lmp,sfu/canvas-lms,wimemx/Canvas,jay3126/canvas-lms,usmschuck/canvas,instructure/canvas-lms,gbleydon/canvas-lms,efrj/canvas-lms,utkarshx/canvas-lms,tgroshon/canvas-lms,skmezanul/canvas-lms,fronteerio/canvas-lms,sdeleon28/canvas-lms,arrivu/arrivu-lms,grahamb/canvas-lms,landonwilkins/canvas-lms,instructure/canvas-lms,juoni/canvas-lms,SwinburneOnline/canvas-lms,matematikk-mooc/canvas-lms,sdeleon28/canvas-lms,skmezanul/canvas-lms,roxolan/canvas-lms,snehakachroo1/LSI_replica,djbender/canvas-lms,ShreniiNepal/shrenii_lmp,matematikk-mooc/canvas-lms,jay3126/canvas-lms,dgynn/canvas-lms,leftplusrightllc/canvas-lms,whalejasmine/canvas-lms,roxolan/canvas-lms,Unow/canvas-lms,loganrun/pincan,leftplusrightllc/canvas-lms,va7map/canvas-lms,redconfetti/canvas-lms,va7map/canvas-lms,djbender/canvas-lms,usmschuck/canvas,shidao-fm/canvas-lms,djbender/canvas-lms,grahamb/canvas-lms,juoni/canvas-lms,roxolan/canvas-lms,eCNAP/CANVAS,instructure/canvas-lms,samuels410/greatlakes-lms,Jyaasa/canvas-lms,AndranikMarkosyan/lms,Jyaasa/canvas-lms,utkarshx/canvas-lms,dgynn/canvas-lms,djbender/canvas-lms,whalejasmine/canvas-lms,venturehive/canvas-lms,sfu/canvas-lms,dgynn/canvas-lms,matematikk-mooc/canvas-lms,sdeleon28/canvas-lms,HotChalk/canvas-lms,juoni/canvas-lms,AndranikMarkosyan/lms,greyhwndz/canvas-lms,dgynn/canvas-lms,va7map/canvas-lms,landonwilkins/canvas-lms,whalejasmine/canvas-lms,loganrun/pincan,wye0220/shindig-canvas,shidao-fm/canvas-lms,Unow/canvas-lms,instructure/canvas-lms,samuels410/greatlakes-lms,instructure/canvas-lms,kyroskoh/canvas-lms,arrivu/jigsaw-lms,gbleydon/canvas-lms,arrivu/arrivu-lms,antoniuslin/canvas-lms,Unow/canvas-lms,arrivu/hoodemo,snehakachroo1/LSI_replica,narigone/canvas,wye0220/shindig-canvas,narigone/canvas,Rvor/canvas-lms,SwinburneOnline/canvas-lms,samuels410/greatlakes-lms,fronteerio/canvas-lms,grahamb/canvas-lms