Clean up some logic/formatting in JSON module

Was looking through the JSON code and cleaned parts of it up