rewrite validate.js; rename, remove old Joi validation