altered the api for emit to take an optional second argument of a struct of arguments.