Remove unused include
Fix compiler warning, comparison of unsigned and signed int
Change CircularBuffer implementation to HistoricalAverage class