Refactor the MemoryStorage class and specs

This PR includes the following refactorings:

* Use a method called `storage` instead of a class variable `@@storage`. With this change, everything is under `class << self`
* Add a `flush` method for testing (because everything stays in the class definition, we need to flush the storage)
* Specs refactoring