Adding criteria.js and tests