Make function work in multithreaded code
Improve performance of function
Use reify instead of proxy, add input function, and add global interop macros