Right now you get different bindings depending on who calls the script. Some times the $message binding is the payload and sometimes its the MuleMessage instance. Not good. I suggest the following bindings:
$muleContext MuleContext
$eventContext MuleEventContext
$message MuleMessage
$log Logger
if MuleMessage is passed in
$payload MuleMessage.getPayload
otherwise
$originalPayload MuleEvent.getMessage.getPayload
$payload MuleEvent.transformMessage()
(all message headers get added to the context too)
For backward compatability:
$src = $payload