def dict2columns(data, id_col=None):
    """Convert a dict-based object to two-column output.

    Also make sure the id field is at top.
    """
    if not data:
        return ({}, {})
    else:
        if id_col is not None and id_col in data:
            keys = [id_col]
            [keys.append(key) for key in sorted(data) if key != id_col]
            items = [(key, data[key]) for key in keys]
        else:
            items = sorted(data.items())
        return list(zip(*items))