add a function to the C api to get the context out of a module, patch