Added docstrings and stuff.
Made extend-morphism behave a bit differently. I forget why I wanted to
do that. I think it was important.
The optree stuff finally works!
Well, mod a sign error somewhere in derivative. I had -1 instead of sgn
before, but I'm still missing something.