convert match to new module conventions
cosmetic fix
added a treequery usage sample
smarter globals detector, goes through tables
fixed leaked globals