Added support for actor functions

An actor function is the same as an actor method, but it may return a value
to the caller. Unlike an actor method, the caller blocks until the result value
is available. Results are passed back safely with a per actor function threadsafe
queue.