Create tests in closure (duh). Fix jgen and tests so everything runs cleanly