Tweaked hash parsing for JSON to not assume hash but also handle arrays.