BI: internal code restructuration

Moved tree rendering code into bi module. New webservice
for rendering a tree (not yet finished).