Fix the run test scripts. 

The tests use environmental variable such as RunFunctionalTests etc. Remove setlocal so that the environmental variables take longer effect.

Also unify the format of URL, for the use of script parameters.