Added ability to import functions from the local context into the thread