adds var key word to validator declaration

The lack of a var keyword can cause errors in stricter JS engines, I was having a problem including this through the karma-browserify preprocessor without it.