Add namespace tests and other improvements

* Extra flash function
* Refactor Tree a little bit
* Class functionality included (no tests yet)
* thanks to @psav for original namespace tests