Adjoint composition

Composition and associated laws for adjoints. The laws are rather slow.  In fact, they're so slow that travis times out after 10 minutes of no output.  I've included a commit to make travis use two threads, which will hopefully prevent this problem.  I'd love ideas on how to speed them up.

This is on top of #251.