Add jacobi() for calculating Jacobi symbol.