started some optimizations, but with not much effect for now
some more optimizations by preventing NULL checks
modified the rotate macro so that it works with any structure that has a left, right and parent reference to variables of itself.
Created a macro for tree find to prevent duplicating this code in insert and delete.
moved tree macros to trbase library, as they are also used in the memory management. Some small fixes