Big refactoring of Dash.

* Backported system from Trash.

* No more class variables.