Change to a generator for buffering and splitting lines from the serial port.