Ditched bufio for manual buffer management.