Added inheritance

* Added JSAV.utils.extend function to create "subclasses"
* Refactored tree.js with the extend function