move tree generation code into treegen; refactor fresh names gen
initial support for deconstruction of for loops