events: clean up emit

* Export error emission to another function
* Minor optimizations for most likely scenarios
events: once() don't call apply() multiple times