Add initial support for async callbacks

Currently only for global variable function pointers