Replace jq by $, plus various js fixes