Redone test for validator, minor code refractoring and bug fixes in idgenerator.js, schemas.js, validator.js