Some constraint solving algorithms in JavaScript