Add C bindings for custom Sources and Sinks

Uses structures of function pointers and an opaque userdata pointer to mimic the C++ Source and Sink objects.