Use commons-cli for exec-params

and slightly improved generated code.

Also added a test that complies the generated code.