add optional hash to events, fix relay script quit

Events can now be dispatched with an optional hash on the end. This is
pretty damn hax for now, and will hopefully be adjusted a bit as time
goes on. But the relay script now works.

Sorry this is a single commit. Someone was feeling lazy and rushed.