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