Convert RJS files for flexible criteria

(And fix the tests for the new `js.erb` files.)