Changed the constructor of variable so it's added to var_table only on set (when assigned) also cleaned up and bugfixing in tree-test.