Jslint fixes

I've run jslint in the code and several issues came out.

Other than some minor bad coding, there were important findings, like the fact that the wsc dialog is creating lots of variables in the global namespace.

I was able to fix some, but there are still many available.