Update addJacobian function for P+∞, ∞+P and P+P.

By handling these in addJacobian we can simply the double-and-add loop.
Minor formatting fix