Adding auto-diff for torsion + tests.

This PR should enable auto-diff for torsion. I added a couple of simple tests as well.