cleanup code and implement Stringer for JSONObject and JSONArray