Add the tolerance option

Now the convergence criteria for the optimization loop can be specified
by the --tolerance command line argument.