lib/tree: separate {leaf,branch}_half from _used and _free
lib/tree: move inline functions above prototypes in node.h
lib/tree: add generic node_used, node_free
redo: link libjgfs2 dependencies at binary link time; add -lm