parallel loops fixed

the main thread wasn't calling the function and there was
an issue with the generated argument list
code cleanup
generated subs in their own package