Updated file-validator.js

- Added option for onValid and other required changes