allow passing priority to registered events

make it possible to define the priority when registering an event callback