Added a rebuild method, so you can regenerate the tree when new content is added to the leaves/nodes. Tidied some whitespace.