rb_tree: Shift helper code into separate file

Move helper routines and macros into separate file.

Signed-off-by: Prashant Malani <p.malani@gmail.com>