Begin adding support for "deriving".

Some things are broken, but I want to get this code out there.