Implemented passing of a python functions as callbacks to C API