Setting the active state through the tree.

Currently very inefficient, I am pushing this out so further work can continue while I work on cleaning up the code.

Signed-off-by: Yuri Tománek <yuri@tomanek.com.au>