code Style refactorings, mostly allows @CompileStatic and @TypeChecked

This declares types in several places, does some casting too.
Gave unique name to iterators in closures

Could not fix all Type checking and static compile problems,
due to weird hacks around command registry

Not including @CompileStatic and @TypeChecked annotations
because maybe this is to be backported to groovy 1.x, and also
I did not see other code here use them