'Find all fields of type reference and convert the payload from UsageKeys to deprecated strings
:param xblock: the XBlock class
:param jsonfields: a dict of the jsonified version of the fields'

def _serialize_scope(self, xblock, scope):

    jsonfields = {}
    for (field_name, field) in xblock.fields.iteritems():
        if ((field.scope == scope) and field.is_set_on(xblock)):
            if (field.scope == Scope.parent):
                continue
            elif isinstance(field, Reference):
                jsonfields[field_name] = unicode(field.read_from(xblock))
            elif isinstance(field, ReferenceList):
                jsonfields[field_name] = [unicode(ele) for ele in field.read_from(xblock)]
            elif isinstance(field, ReferenceValueDict):
                jsonfields[field_name] = {key: unicode(subvalue) for (key, subvalue) in field.read_from(xblock).iteritems()}
            else:
                jsonfields[field_name] = field.read_json(xblock)
    return jsonfields
