Changed memory storage to a circular buffer

It is part of the package. However when I remove it, the test does not compile because types defined in memory like StatsBuffer are undefined.