Adding a wrap function for callbacks, throw, and catch support.