Improved CMD/BAT test with the 2 function types

Also added more complex arguments and variables handling