Dill pickling

Changes:

- Use dill for pickling. Supports `Function("f")` but not subclasses of `Function`; `ReferenceFrame` should work.
- Reindented and refactored code somewhat.

Note that to deploy, you must setup dill first:

    cd dill
    python2 setup.py build

as dill requires that it is built via setuptools.