Added scope walking for JSON serializer and test cases