Remove unused scripts and functions from treetable.