```python
def tags_of(line):
    """
    Breaks a comma-separated line into its tags, trimming the spaces around each and leaving out any that come to nothing.
    """
    if not line:
        return []
    tags = [tag.strip() for tag in line.split(',')]
    return [tag for tag in tags if tag]

def tag_index(lines):
    """
    Returns a mapping from each tag to the lines carrying it, in the order the lines came.
    """
    if not lines:
        return {}
    tag_index = {}
    for line in lines:
        if not line.strip():
            continue
        tag = line.split(',')[0].strip()
        if tag not in tag_index:
            tag_index[tag] = []
        tag_index[tag].append(line)
    return tag_index
```