Added tree module
Added better exception testing