Fix crash when optional callback is not provided.
Rename send_to_app*() to write*(). Remove send_sequence_to_app().
Function for monkey patching a class instance.