Make big changes in communication between invoker and optimizer

invoke(f, fargs) is now invoke(caller, fargs). Also, before invoke is
called by an optimizer, the attributes f, param_spec and return_spec
will be set to their correct values.
Merge branch 'returnspec' into develop