refactored logging
refactored node allocation

node_alloc() doesn't insert node to the tree
added node_insert()
root is static now, added node_get_root()