added CircularBuffer and LineReader that uses it