All used variables are now defined, avoiding global variable issues.

Also dumped up the JSLint coverage a bit.