def parse_line(data):
    """ Takes an IRC line and breaks it into the three main parts; the prefix,
    command, and parameters. It gets returned in the form of 
    ``(prefix, command, params)``.
    This follows :rfc:`2812#section-2.3.1`, section 2.3.1 regarding message 
    format. 
                
        >>> message = ":nickname!myuser@myhost.net PRIVMSG #gerty :Hello!"
        >>> parse_line(message)
        ('nickname!myuser@myhost.net', 'PRIVMSG', ['#gerty', 'Hello!'])
    """
    if data[0] == ':':
        prefix, data = data[1:].split(' ', 1)
    else:
        prefix = None
    if ' :' in data:
        data, trailing = data.split(' :', 1)
        params = data.split()
        params.append(trailing)
    else:
        params = data.split()
    return prefix, params[0], params[1:]
