Add globals to tree objects

to allow accessing global state in twalk functions.
Add RDB_TOPO for displaying topology info.