clean up
chain exception
Update to registration of functions in OSGi:

Functions are no longer registered as classes in the service Registry,
but as FunctionDefinition objects. Now functions can use type checking
again, FIXES #82

A function class can be obtained from a FunctionDefinition using
getFunctionClass, and a FunctionInterface using getFunctionInstance