Wrap the body of test/tree-construction.lua in a function...

To allow narrower local variable scope and more accurate timing.