moved validator.js to lib