Replaced CircularStream implementation

Finally implemetned own CircularStream. The other code was buggy and
relayed on a CircularBuffer class not really needed here. Also I was not
sure about mixing licenses, so just implemented a CircularStream from
scratch.