Syntactic simplification of the @functor annotation and quite a few bug
fixes.