Function requires a pure Python function and not a Cython function.

So we wrap the function op in our own function. At the same time we're
also handling unbounded methods.

fixes #10