Returns typed subtopic data from an FC.

def typed_subtopic_data(fc, subid):
    '''Returns typed subtopic data from an FC.'''
    # I don't think this code will change after we fix the data race bug. ---AG
    ty = subtopic_type(subid)
    data = get_unicode_feature(fc, subid)
    assert isinstance(data, unicode), \
        'data should be `unicode` but is %r' % type(data)
    if ty == 'image':
        img_data = get_unicode_feature(fc, subid + '|data')
        img = re.sub('^data:image/[a-zA-Z]+;base64,', '', img_data)
        img = base64.b64decode(img.encode('utf-8'))
        return data, img
    elif ty in ('text', 'manual'):
        return data
    raise ValueError('unrecognized subtopic type "%s"' % ty)