Make json_root a method so it can be over-ridden if needed

Also added a guard against arr_rep not being set if json_root isn't present.