Move criterion-formset functions into site.js