Add API that makes it easier to interoperate with C callbacks

Haha that didn't even occur to me. I suppose that's the kind of change you can make when you own the source. :D