End of refactor

* Simplified storage
* various bugfixes
Design
All code merged in a single file