Refactoring

* Removed redundant fields isLeaf and isRoot from Node class.
* Removed layoutIndex. A layout algorithm object is passe directly instead (IoC).