Add isNode method.
Add getAllNodes method
Fix isLast method. Throw error if method is not node of tree.
added isFirst method
fixed isLast method