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
Merge pull request #212 from agl/master

Clean up double-and-add loop.