Made a few null checks more readable
Simplified JSONException and added new constructor
Removed some repeated code.
Adding generics to JSONObject
Refactored JSONArray, JSONObject into new JSONBase

JSONBase is the new super class of JSONArray and JSONObject. Much
of the JSONArray and JSONObject interfaces are similar.